@tdesign/uniapp 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/action-sheet/action-sheet.vue +3 -5
  3. package/dist/avatar/avatar.vue +6 -6
  4. package/dist/avatar-group/avatar-group.vue +1 -3
  5. package/dist/back-top/back-top.vue +13 -15
  6. package/dist/badge/badge.vue +1 -3
  7. package/dist/button/button.vue +15 -14
  8. package/dist/calendar/README.en-US.md +1 -0
  9. package/dist/calendar/README.md +1 -0
  10. package/dist/calendar/calendar-header.vue +1 -3
  11. package/dist/calendar/calendar.vue +28 -19
  12. package/dist/calendar/props.ts +5 -0
  13. package/dist/calendar/template.vue +1 -3
  14. package/dist/calendar/type.ts +6 -0
  15. package/dist/cascader/cascader.vue +1 -3
  16. package/dist/cell/cell.vue +51 -35
  17. package/dist/cell-group/cell-group.vue +1 -3
  18. package/dist/check-tag/check-tag.vue +12 -15
  19. package/dist/checkbox/checkbox.vue +13 -15
  20. package/dist/col/col.vue +1 -3
  21. package/dist/collapse/collapse.vue +1 -3
  22. package/dist/collapse-panel/collapse-panel.vue +1 -3
  23. package/dist/color-picker/color-picker.vue +2 -4
  24. package/dist/color-picker/template.vue +1 -3
  25. package/dist/common/src/instantiationDecorator.js +6 -0
  26. package/dist/count-down/count-down.vue +2 -4
  27. package/dist/date-time-picker/date-time-picker.vue +1 -3
  28. package/dist/dialog/dialog.vue +67 -69
  29. package/dist/divider/divider.vue +1 -3
  30. package/dist/draggable/draggable.vue +1 -3
  31. package/dist/drawer/drawer.vue +1 -3
  32. package/dist/dropdown-item/dropdown-item.vue +1 -3
  33. package/dist/dropdown-menu/dropdown-menu.vue +12 -14
  34. package/dist/empty/empty.vue +1 -3
  35. package/dist/fab/fab.vue +1 -3
  36. package/dist/footer/footer.vue +1 -3
  37. package/dist/form/form.vue +1 -3
  38. package/dist/form-item/form-item.css +16 -11
  39. package/dist/form-item/form-item.vue +2 -7
  40. package/dist/grid/grid.vue +1 -3
  41. package/dist/grid-item/grid-item.vue +1 -3
  42. package/dist/guide/content.vue +1 -3
  43. package/dist/guide/guide.vue +3 -8
  44. package/dist/icon/icon.vue +1 -3
  45. package/dist/image/image.vue +1 -3
  46. package/dist/image-viewer/image-viewer.vue +27 -30
  47. package/dist/indexes/indexes.vue +5 -7
  48. package/dist/indexes-anchor/indexes-anchor.vue +1 -3
  49. package/dist/input/input.vue +31 -31
  50. package/dist/link/link.vue +25 -26
  51. package/dist/loading/loading.vue +2 -2
  52. package/dist/message/index.d.ts +1 -1
  53. package/dist/message/message.interface.ts +2 -1
  54. package/dist/message-item/message-item.vue +34 -36
  55. package/dist/mixins/page-scroll.js +1 -1
  56. package/dist/navbar/navbar.vue +46 -33
  57. package/dist/notice-bar/notice-bar.vue +24 -26
  58. package/dist/overlay/overlay.vue +5 -7
  59. package/dist/picker/picker.vue +3 -4
  60. package/dist/picker-item/picker-item.vue +2 -4
  61. package/dist/popover/popover.vue +1 -3
  62. package/dist/popup/popup.vue +1 -3
  63. package/dist/progress/progress.vue +1 -3
  64. package/dist/pull-down-refresh/pull-down-refresh.vue +13 -15
  65. package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +1 -3
  66. package/dist/qrcode/components/qrcode-status/qrcode-status.vue +1 -3
  67. package/dist/qrcode/qrcode.vue +1 -3
  68. package/dist/radio/radio.vue +17 -19
  69. package/dist/rate/rate.vue +1 -3
  70. package/dist/result/result.vue +1 -3
  71. package/dist/row/row.vue +1 -3
  72. package/dist/search/search.vue +8 -3
  73. package/dist/side-bar/side-bar.vue +1 -3
  74. package/dist/side-bar-item/side-bar-item.vue +12 -15
  75. package/dist/skeleton/skeleton.vue +2 -4
  76. package/dist/slider/slider.vue +1 -3
  77. package/dist/step-item/step-item.vue +1 -3
  78. package/dist/stepper/stepper.vue +1 -3
  79. package/dist/steps/steps.vue +1 -2
  80. package/dist/sticky/sticky.vue +1 -3
  81. package/dist/swipe-cell/swipe-cell.vue +2 -5
  82. package/dist/swiper/swiper.vue +1 -3
  83. package/dist/swiper-nav/swiper-nav.vue +1 -3
  84. package/dist/switch/switch.vue +1 -3
  85. package/dist/tab-bar/tab-bar.vue +2 -1
  86. package/dist/tab-bar-item/tab-bar-item.vue +22 -25
  87. package/dist/tab-panel/tab-panel.vue +1 -3
  88. package/dist/tabs/tabs.vue +1 -2
  89. package/dist/tag/tag.vue +23 -26
  90. package/dist/textarea/textarea.vue +1 -3
  91. package/dist/toast/toast.vue +12 -14
  92. package/dist/transition/transition.vue +1 -3
  93. package/dist/tree-select/tree-select.vue +6 -9
  94. package/dist/upload/upload.vue +1 -3
  95. package/dist/watermark/watermark.vue +1 -2
  96. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ toc: false
5
5
  docClass: timeline
6
6
  ---
7
7
 
8
+ ## 🌈 0.7.2 `2026-02-26`
9
+
10
+ ### 🚀 Features
11
+
12
+ - `Calendar`: 新增 `PopupProps` 属性,透传至 `Popup` @novlan1 ([#4264](https://github.com/Tencent/tdesign-miniprogram/pull/4264))
13
+ - `Navbar`: 支持监听页面变化,重新计算尺寸 @novlan1 ([#4282](https://github.com/Tencent/tdesign-miniprogram/pull/4282))
14
+
15
+ ### 🐞 Bug Fixes
16
+
17
+ - `Button`: 修复 `icon.size` 不生效问题 @novlan1 ([#4264](https://github.com/Tencent/tdesign-miniprogram/pull/4264))
18
+ - `Form`: 修改边距错误问题 @novlan1 ([#4282](https://github.com/Tencent/tdesign-miniprogram/pull/4282))
19
+ - `Search`: 修复 `value` 未监听问题 @novlan1 ([#4264](https://github.com/Tencent/tdesign-miniprogram/pull/4264))
20
+
8
21
  ## 🌈 0.7.1 `2026-02-04`
9
22
 
10
23
  ### 🚀 Features
@@ -11,7 +11,7 @@
11
11
  :custom-navbar-height="customNavbarHeight"
12
12
  :show-overlay="dataShowOverlay"
13
13
  :z-index="(dataPopupProps && dataPopupProps.zIndex) || defaultPopUpzIndex"
14
- :overlay-props="(dataPopupProps && dataPopupProps.overlayProps) || defaultPopUpProps"
14
+ :overlay-props="(dataPopupProps && dataPopupProps.overlayProps) || defaultOverlayProps"
15
15
  @visible-change="onPopupVisibleChange"
16
16
  >
17
17
  <view
@@ -224,7 +224,7 @@ export default uniComponent({
224
224
  classPrefix: name,
225
225
  gridThemeItems: [],
226
226
  currentSwiperIndex: 0,
227
- defaultPopUpProps: {},
227
+ defaultOverlayProps: {},
228
228
  defaultPopUpzIndex: 11500,
229
229
  tools,
230
230
 
@@ -362,6 +362,4 @@ export default uniComponent({
362
362
  });
363
363
  </script>
364
364
 
365
- <style scoped>
366
- @import './action-sheet.css';
367
- </style>
365
+ <style scoped src="./action-sheet.css"></style>
@@ -83,7 +83,7 @@ import TImage from '../image/image';
83
83
  import { uniComponent } from '../common/src/index';
84
84
  import { prefix } from '../common/config';
85
85
  import avatarProps from './props';
86
- import { setIcon, systemInfo } from '../common/utils';
86
+ import { setIcon, systemInfo, addUnit } from '../common/utils';
87
87
  import tools from '../common/utils.wxs';
88
88
  import * as utils from './computed.js';
89
89
  import { ChildrenMixin, RELATION_MAP } from '../common/relation';
@@ -139,10 +139,12 @@ export default uniComponent({
139
139
  medium: 'var(--td-avatar-icon-medium-font-size, 24px)',
140
140
  large: 'var(--td-avatar-icon-large-font-size, 32px)',
141
141
  };
142
- if (!fontSize[this.dataSize]) return '';
142
+
143
143
  return tools._style([
144
144
  {
145
- fontSize: fontSize[this.dataSize],
145
+ fontSize: this.iconData.size
146
+ ? addUnit(this.iconData.size)
147
+ : fontSize[this.dataSize],
146
148
  },
147
149
  this.iconData.style || '',
148
150
  ]);
@@ -195,6 +197,4 @@ export default uniComponent({
195
197
  });
196
198
 
197
199
  </script>
198
- <style scoped>
199
- @import './avatar.css';
200
- </style>
200
+ <style scoped src="./avatar.css"></style>
@@ -116,6 +116,4 @@ export default uniComponent({
116
116
  },
117
117
  });
118
118
  </script>
119
- <style scoped>
120
- @import './avatar-group.css';
121
- </style>
119
+ <style scoped src="./avatar-group.css"></style>
@@ -12,20 +12,20 @@
12
12
  >
13
13
  <slot name="icon" />
14
14
  <block
15
- v-if="_icon"
15
+ v-if="innerIcon"
16
16
  name="icon"
17
17
  >
18
18
  <t-icon
19
- :custom-style="_icon.style || ''"
19
+ :custom-style="innerIcon.style || ''"
20
20
  :t-class="tClassIcon"
21
- :prefix="_icon.prefix"
22
- :name="_icon.name"
23
- :size="_icon.size"
24
- :color="_icon.color"
25
- :aria-hidden="!!_icon.ariaHidden"
26
- :aria-label="_icon.ariaLabel"
27
- :aria-role="_icon.ariaRole"
28
- @click="_icon.click || ''"
21
+ :prefix="innerIcon.prefix"
22
+ :name="innerIcon.name"
23
+ :size="innerIcon.size"
24
+ :color="innerIcon.color"
25
+ :aria-hidden="!!innerIcon.ariaHidden"
26
+ :aria-label="innerIcon.ariaLabel"
27
+ :aria-role="innerIcon.ariaRole"
28
+ @click="innerIcon.click || ''"
29
29
  />
30
30
  </block>
31
31
  </view>
@@ -90,7 +90,7 @@ export default uniComponent({
90
90
  },
91
91
  methods: {
92
92
  setIcon(v) {
93
- this._icon = calcIcon(v, 'backtop');
93
+ this.innerIcon = calcIcon(v, 'backtop');
94
94
  },
95
95
 
96
96
  toTop() {
@@ -110,13 +110,11 @@ export default uniComponent({
110
110
  return {
111
111
  prefix,
112
112
  classPrefix: name,
113
- _icon: null,
113
+ innerIcon: null,
114
114
  hidden: true,
115
115
  tools,
116
116
  };
117
117
  },
118
118
  });
119
119
  </script>
120
- <style scoped>
121
- @import './back-top.css';
122
- </style>
120
+ <style scoped src="./back-top.css"></style>
@@ -129,6 +129,4 @@ export default uniComponent({
129
129
  },
130
130
  });
131
131
  </script>
132
- <style scoped>
133
- @import './badge.css';
134
- </style>
132
+ <style scoped src="./badge.css"></style>
@@ -32,16 +32,16 @@
32
32
  @agreeprivacyauthorization="agreeprivacyauthorization"
33
33
  >
34
34
  <block
35
- v-if="_icon"
35
+ v-if="innerIcon"
36
36
  name="icon"
37
37
  >
38
38
  <t-icon
39
39
  :custom-style="iconCustomStyle"
40
- :t-class="classPrefix + '__icon ' + classPrefix + '__icon--' + (_icon.activeIdx == _icon.index ? 'active ' : ' ') + tClassIcon"
41
- :prefix="_icon.prefix"
42
- :name="_icon.name || ''"
43
- :size="_icon.size"
44
- :color="_icon.color"
40
+ :t-class="classPrefix + '__icon ' + classPrefix + '__icon--' + (innerIcon.activeIdx == innerIcon.index ? 'active ' : ' ') + tClassIcon"
41
+ :prefix="innerIcon.prefix"
42
+ :name="innerIcon.name || ''"
43
+ :size="innerIcon.size"
44
+ :color="innerIcon.color"
45
45
  @click="'handleClose' || ''"
46
46
  />
47
47
  </block>
@@ -65,7 +65,7 @@
65
65
  />
66
66
  <view
67
67
  :class="classPrefix + '__content '
68
- + ((_icon && _icon.name || loading) && content ? classPrefix + '__content--has-icon' : '')"
68
+ + ((innerIcon && innerIcon.name || loading) && content ? classPrefix + '__content--has-icon' : '')"
69
69
  >
70
70
  <slot name="content" />
71
71
  <block v-if="content">
@@ -82,7 +82,7 @@ import TLoading from '../loading/loading';
82
82
  import { uniComponent } from '../common/src/index';
83
83
  import { prefix } from '../common/config';
84
84
  import props from './props';
85
- import { calcIcon } from '../common/utils';
85
+ import { calcIcon, addUnit } from '../common/utils';
86
86
  import tools from '../common/utils.wxs';
87
87
 
88
88
 
@@ -115,7 +115,7 @@ export default uniComponent({
115
115
  prefix,
116
116
  className: '',
117
117
  classPrefix: name,
118
- _icon: undefined,
118
+ innerIcon: undefined,
119
119
  };
120
120
  },
121
121
  computed: {
@@ -129,10 +129,12 @@ export default uniComponent({
129
129
 
130
130
  return tools._style([
131
131
  {
132
- fontSize: fontSize[this.size || 'medium'],
132
+ fontSize: this.innerIcon.size
133
+ ? addUnit(this.innerIcon.size)
134
+ : fontSize[this.size || 'medium'],
133
135
  borderRadius: 'var(--td-button-icon-border-radius, 4px)',
134
136
  },
135
- this._icon.style || '',
137
+ this.innerIcon.style || '',
136
138
  ]);
137
139
  },
138
140
  loadingCustomStyle() {
@@ -146,7 +148,7 @@ export default uniComponent({
146
148
  watch: {
147
149
  icon: {
148
150
  handler(value) {
149
- this._icon = calcIcon(value, '');
151
+ this.innerIcon = calcIcon(value, '');
150
152
  },
151
153
  immediate: true,
152
154
  },
@@ -214,9 +216,8 @@ export default uniComponent({
214
216
  },
215
217
  });
216
218
  </script>
219
+ <style scoped src="./button.css"></style>
217
220
  <style scoped>
218
- @import './button.css';
219
-
220
221
  /* #ifdef MP-QQ */
221
222
  /* 适配 qq 小程序 */
222
223
  .t-button--outline {
@@ -15,6 +15,7 @@ format | Function | - | Typescript: `CalendarFormatType ` `type CalendarFormatTy
15
15
  locale-text | Object | - | Typescript: `CalendarLocaleText` `interface CalendarLocaleText {title?: string; weekdays?: string[]; monthTitle?: string; months?: string[]; confirm?: string;}`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/calendar/type.ts) | N
16
16
  max-date | Number | - | \- | N
17
17
  min-date | Number | - | \- | N
18
+ popup-props | Object | {} | popup properties。Typescript: `PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/calendar/type.ts) | N
18
19
  readonly | Boolean | - | \- | N
19
20
  switch-mode | String | none | options: none/month/year-month | N
20
21
  title | String | - | \- | N
@@ -65,6 +65,7 @@ format | Function | - | 用于格式化日期的函数。TS 类型:`CalendarFo
65
65
  locale-text | Object | - | 国际化文案。TS 类型:`CalendarLocaleText` `interface CalendarLocaleText {title?: string; weekdays?: string[]; monthTitle?: string; months?: string[]; confirm?: string;}`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/calendar/type.ts) | N
66
66
  max-date | Number | - | 最大可选的日期,不传则默认半年后 | N
67
67
  min-date | Number | - | 最小可选的日期,不传则默认今天 | N
68
+ popup-props | Object | {} | 透传 Popup 组件全部属性。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/calendar/type.ts) | N
68
69
  readonly | Boolean | - | 是否只读,只读状态下不能选择日期 | N
69
70
  switch-mode | String | none | 切换模式。 `none` 表示平铺展示所有月份; `month` 表示支持按月切换, `year-month` 表示既按年切换,也支持按月切换。可选项:none/month/year-month | N
70
71
  title | String | - | 标题,不传默认为“请选择日期” | N
@@ -93,6 +93,4 @@ export default {
93
93
 
94
94
  </script>
95
95
 
96
- <style scoped>
97
- @import './calendar.css';
98
- </style>
96
+ <style scoped src="./calendar.css"></style>
@@ -3,9 +3,12 @@
3
3
  <t-popup
4
4
  v-if="usePopup"
5
5
  :visible="visible"
6
- :using-custom-navbar="usingCustomNavbar"
7
- :custom-navbar-height="customNavbarHeight"
8
6
  placement="bottom"
7
+ :show-overlay="isShowOverlay(popupProps && popupProps.showOverlay, true)"
8
+ :using-custom-navbar="usingCustomNavbar || (popupProps && popupProps.usingCustomNavbar)"
9
+ :custom-navbar-height="coalesce(customNavbarHeight, popupProps && popupProps.usingCustomNavbar)"
10
+ :z-index="(popupProps && popupProps.zIndex)"
11
+ :overlay-props="(popupProps && popupProps.overlayProps) || defaultOverlayProps"
9
12
  @visible-change="onVisibleChange"
10
13
  >
11
14
  <CalendarTemplate
@@ -153,6 +156,8 @@ export default uniComponent({
153
156
  dataVisible: this.visible,
154
157
  dataValue: coalesce(this.value, this.defaultValue),
155
158
  days: [],
159
+
160
+ defaultOverlayProps: {},
156
161
  };
157
162
  },
158
163
  watch: {
@@ -253,6 +258,8 @@ export default uniComponent({
253
258
  }
254
259
  },
255
260
  methods: {
261
+ coalesce,
262
+
256
263
  getMonthTitle,
257
264
  getDateLabel,
258
265
  isDateSelected,
@@ -291,23 +298,23 @@ export default uniComponent({
291
298
  },
292
299
 
293
300
  updateActionButton(value) {
294
- const _min = this.getCurrentYearAndMonth(this.base.minDate);
295
- const _max = this.getCurrentYearAndMonth(this.base.maxDate);
296
- const _value = this.getCurrentYearAndMonth(value);
301
+ const iMin = this.getCurrentYearAndMonth(this.base.minDate);
302
+ const iMax = this.getCurrentYearAndMonth(this.base.maxDate);
303
+ const iValue = this.getCurrentYearAndMonth(value);
297
304
 
298
- const _minTimestamp = new Date(_min.year, _min.month, 1).getTime();
299
- const _maxTimestamp = new Date(_max.year, _max.month, 1).getTime();
300
- const _dateValue = new Date(_value.year, _value.month, 1);
305
+ const iMinTimestamp = new Date(iMin.year, iMin.month, 1).getTime();
306
+ const iMaxTimestamp = new Date(iMax.year, iMax.month, 1).getTime();
307
+ const iDateValue = new Date(iValue.year, iValue.month, 1);
301
308
 
302
- const _prevYearTimestamp = getPrevYear(_dateValue).getTime();
303
- const _prevMonthTimestamp = getPrevMonth(_dateValue).getTime();
304
- const _nextMonthTimestamp = getNextMonth(_dateValue).getTime();
305
- const _nextYearTimestamp = getNextYear(_dateValue).getTime();
309
+ const iPrevYearTimestamp = getPrevYear(iDateValue).getTime();
310
+ const iPrevMonthTimestamp = getPrevMonth(iDateValue).getTime();
311
+ const iNextMonthTimestamp = getNextMonth(iDateValue).getTime();
312
+ const iNextYearTimestamp = getNextYear(iDateValue).getTime();
306
313
 
307
- const preYearBtnDisable = _prevYearTimestamp < _minTimestamp || _prevMonthTimestamp < _minTimestamp;
308
- const prevMonthBtnDisable = _prevMonthTimestamp < _minTimestamp;
309
- const nextYearBtnDisable = _nextMonthTimestamp > _maxTimestamp || _nextYearTimestamp > _maxTimestamp;
310
- const nextMonthBtnDisable = _nextMonthTimestamp > _maxTimestamp;
314
+ const preYearBtnDisable = iPrevYearTimestamp < iMinTimestamp || iPrevMonthTimestamp < iMinTimestamp;
315
+ const prevMonthBtnDisable = iPrevMonthTimestamp < iMinTimestamp;
316
+ const nextYearBtnDisable = iNextMonthTimestamp > iMaxTimestamp || iNextYearTimestamp > iMaxTimestamp;
317
+ const nextMonthBtnDisable = iNextMonthTimestamp > iMaxTimestamp;
311
318
 
312
319
  this.actionButtons = {
313
320
  preYearBtnDisable,
@@ -440,12 +447,14 @@ export default uniComponent({
440
447
  maxDate && (this.base.maxDate = maxDate);
441
448
  this.calcMonths();
442
449
  },
450
+
451
+ isShowOverlay(value, defaultValue) {
452
+ return tools.isBoolean(value) ? value : defaultValue;
453
+ },
443
454
  },
444
455
  });
445
456
  </script>
446
- <style scoped>
447
- @import './calendar.css';
448
- </style>
457
+ <style scoped src="./calendar.css"></style>
449
458
  <style scoped>
450
459
  .t-calendar-switch-mode--none > .t-calendar__months {
451
460
  /* support mp-alipay */
@@ -39,6 +39,11 @@ export default {
39
39
  minDate: {
40
40
  type: Number,
41
41
  },
42
+ /** 透传 Popup 组件全部属性 */
43
+ popupProps: {
44
+ type: Object,
45
+ default: () => ({}),
46
+ },
42
47
  /** 是否只读,只读状态下不能选择日期 */
43
48
  readonly: Boolean,
44
49
  /** 切换模式。 `none` 表示平铺展示所有月份; `month` 表示支持按月切换, `year-month` 表示既按年切换,也支持按月切换 */
@@ -256,6 +256,4 @@ export default {
256
256
  };
257
257
 
258
258
  </script>
259
- <style scoped>
260
- @import './calendar.css';
261
- </style>
259
+ <style scoped src="./calendar.css"></style>
@@ -5,6 +5,7 @@
5
5
  * */
6
6
 
7
7
  import type { TdButtonProps as ButtonProps } from '../button/type';
8
+ import type { TdPopupProps as PopupProps } from '../popup/type';
8
9
 
9
10
  export interface TdCalendarProps {
10
11
  /**
@@ -43,6 +44,11 @@ export interface TdCalendarProps {
43
44
  * 最小可选的日期,不传则默认今天
44
45
  */
45
46
  minDate?: number;
47
+ /**
48
+ * 透传 Popup 组件全部属性
49
+ * @default {}
50
+ */
51
+ popupProps?: PopupProps;
46
52
  /**
47
53
  * 是否只读,只读状态下不能选择日期
48
54
  */
@@ -518,6 +518,4 @@ export default uniComponent({
518
518
  },
519
519
  });
520
520
  </script>
521
- <style scoped>
522
- @import './cascader.css';
523
- </style>
521
+ <style scoped src="./cascader.css"></style>
@@ -13,18 +13,18 @@
13
13
  >
14
14
  <view :class="classPrefix + '__left ' + tClassLeft">
15
15
  <block
16
- v-if="_leftIcon"
16
+ v-if="iLeftIcon"
17
17
  name="icon"
18
18
  >
19
19
  <t-icon
20
20
  :custom-style="leftIconCustomStyle"
21
21
  :t-class="classPrefix + '__left-icon ' + tClassLeftIcon"
22
- :name="_leftIcon.name"
23
- :size="_leftIcon.size"
24
- :color="_leftIcon.color"
22
+ :name="iLeftIcon.name"
23
+ :size="iLeftIcon.size"
24
+ :color="iLeftIcon.color"
25
25
  :aria-hidden="true"
26
- :aria-label="_leftIcon.ariaLabel"
27
- :aria-role="_leftIcon.ariaRole"
26
+ :aria-label="iLeftIcon.ariaLabel"
27
+ :aria-role="iLeftIcon.ariaRole"
28
28
  @click="'handleClose' || ''"
29
29
  />
30
30
  </block>
@@ -93,31 +93,31 @@
93
93
  ]"
94
94
  >
95
95
  <t-icon
96
- v-if="_arrow"
96
+ v-if="rightArrow"
97
97
  :custom-style="rightArrowCustomStyle"
98
98
  :t-class=" classPrefix + '__right-icon ' + tClassRightIcon"
99
- :name="_arrow.name || ''"
100
- :size="_arrow.size"
101
- :color="_arrow.color"
99
+ :name="rightArrow.name || ''"
100
+ :size="rightArrow.size"
101
+ :color="rightArrow.color"
102
102
  :aria-hidden="true"
103
- :aria-label="_arrow.ariaLabel"
104
- :aria-role="_arrow.ariaRole"
103
+ :aria-label="rightArrow.ariaLabel"
104
+ :aria-role="rightArrow.ariaRole"
105
105
  @click="'handleClose' || ''"
106
106
  />
107
107
  <block v-else>
108
108
  <block
109
- v-if="_rightIcon"
109
+ v-if="iRightIcon"
110
110
  name="icon"
111
111
  >
112
112
  <t-icon
113
113
  :custom-style="rightIconCustomStyle"
114
114
  :t-class=" classPrefix + '__right-icon ' + tClassRightIcon"
115
- :name="_rightIcon.name"
116
- :size="_rightIcon.size"
117
- :color="_rightIcon.color || ''"
115
+ :name="iRightIcon.name"
116
+ :size="iRightIcon.size"
117
+ :color="iRightIcon.color || ''"
118
118
  :aria-hidden="true"
119
- :aria-label="_rightIcon.ariaLabel"
120
- :aria-role="_rightIcon.ariaRole"
119
+ :aria-label="iRightIcon.ariaLabel"
120
+ :aria-role="iRightIcon.ariaRole"
121
121
  @click="'handleClose' || ''"
122
122
  />
123
123
  </block>
@@ -132,7 +132,7 @@ import TImage from '../image/image';
132
132
  import { uniComponent } from '../common/src/index';
133
133
  import { prefix } from '../common/config';
134
134
  import props from './props';
135
- import { calcIcon } from '../common/utils';
135
+ import { calcIcon, addUnit } from '../common/utils';
136
136
  import tools from '../common/utils.wxs';
137
137
 
138
138
  import { ChildrenMixin, RELATION_MAP } from '../common/relation';
@@ -177,9 +177,9 @@ export default uniComponent({
177
177
  return {
178
178
  prefix,
179
179
  classPrefix: name,
180
- _arrow: null,
181
- _rightIcon: null,
182
- _leftIcon: null,
180
+ rightArrow: null,
181
+ iRightIcon: null,
182
+ iLeftIcon: null,
183
183
  isLastChild: false,
184
184
  tools,
185
185
  };
@@ -187,25 +187,43 @@ export default uniComponent({
187
187
  computed: {
188
188
  rightArrowCustomStyle() {
189
189
  return tools._style([
190
- COMMON_RIGHT_ICON_STYLE,
190
+ {
191
+ color: this.rightArrow.color
192
+ ? this.rightArrow.color
193
+ : COMMON_RIGHT_ICON_STYLE.color,
194
+ fontSize: this.rightArrow.size
195
+ ? addUnit(this.rightArrow.size)
196
+ : COMMON_RIGHT_ICON_STYLE.fontSize,
197
+ },
191
198
  this.rightIconStyle || '',
192
- this._arrow.style || '',
199
+ this.rightArrow.style || '',
193
200
  ]);
194
201
  },
195
202
  rightIconCustomStyle() {
196
203
  return tools._style([
197
- COMMON_RIGHT_ICON_STYLE,
204
+ {
205
+ color: this.iRightIcon.color
206
+ ? this.iRightIcon.color
207
+ : COMMON_RIGHT_ICON_STYLE.color,
208
+ fontSize: this.iRightIcon.size
209
+ ? addUnit(this.iRightIcon.size)
210
+ : COMMON_RIGHT_ICON_STYLE.fontSize,
211
+ },
198
212
  this.rightIconStyle || '',
199
- this._rightIcon.style || '',
213
+ this.iRightIcon.style || '',
200
214
  ]);
201
215
  },
202
216
  leftIconCustomStyle() {
203
217
  return tools._style([
204
218
  {
205
- color: 'var(--td-cell-left-icon-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)))',
206
- fontSize: 'var(--td-cell-left-icon-font-size, 24px)',
219
+ color: this.iLeftIcon.color
220
+ ? this.iLeftIcon.color
221
+ : 'var(--td-cell-left-icon-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)))',
222
+ fontSize: this.iLeftIcon.size
223
+ ? addUnit(this.iLeftIcon.size)
224
+ : 'var(--td-cell-left-icon-font-size, 24px)',
207
225
  },
208
- this._leftIcon.style || '',
226
+ this.iLeftIcon.style || '',
209
227
  ]);
210
228
  },
211
229
  leftImageCustomStyle() {
@@ -218,19 +236,19 @@ export default uniComponent({
218
236
  watch: {
219
237
  leftIcon: {
220
238
  handler(e) {
221
- this.setIcon('_leftIcon', e, '');
239
+ this.setIcon('iLeftIcon', e, '');
222
240
  },
223
241
  immediate: true,
224
242
  },
225
243
  rightIcon: {
226
244
  handler(e) {
227
- this.setIcon('_rightIcon', e, '');
245
+ this.setIcon('iRightIcon', e, '');
228
246
  },
229
247
  immediate: true,
230
248
  },
231
249
  arrow: {
232
250
  handler(e) {
233
- this.setIcon('_arrow', e, 'chevron-right');
251
+ this.setIcon('rightArrow', e, 'chevron-right');
234
252
  },
235
253
  immediate: true,
236
254
  },
@@ -255,6 +273,4 @@ export default uniComponent({
255
273
  },
256
274
  });
257
275
  </script>
258
- <style scoped>
259
- @import './cell.css';
260
- </style>
276
+ <style scoped src="./cell.css"></style>
@@ -64,6 +64,4 @@ export default uniComponent({
64
64
  },
65
65
  });
66
66
  </script>
67
- <style scoped>
68
- @import './cell-group.css';
69
- </style>
67
+ <style scoped src="./cell-group.css"></style>
@@ -9,19 +9,19 @@
9
9
  :class="classPrefix + '__icon'"
10
10
  >
11
11
  <block
12
- v-if="_icon"
12
+ v-if="innerIcon"
13
13
  name="icon"
14
14
  >
15
15
  <t-icon
16
- :custom-style="_icon.style || ''"
16
+ :custom-style="innerIcon.style || ''"
17
17
  :t-class="prefix + '-icon'"
18
- :prefix="_icon.prefix"
19
- :name="_icon.name"
20
- :size="_icon.size"
21
- :color="_icon.color"
22
- :aria-hidden="!!_icon.ariaHidden"
23
- :aria-label="_icon.ariaLabel"
24
- :aria-role="_icon.ariaRole"
18
+ :prefix="innerIcon.prefix"
19
+ :name="innerIcon.name"
20
+ :size="innerIcon.size"
21
+ :color="innerIcon.color"
22
+ :aria-hidden="!!innerIcon.ariaHidden"
23
+ :aria-label="innerIcon.ariaLabel"
24
+ :aria-role="innerIcon.ariaRole"
25
25
  />
26
26
  </block>
27
27
  <slot name="icon" />
@@ -84,7 +84,7 @@ export default uniComponent({
84
84
  classPrefix: name,
85
85
  className: '',
86
86
  tools,
87
- _icon: null,
87
+ innerIcon: null,
88
88
 
89
89
  dataChecked: coalesce(this.checked, this.defaultChecked),
90
90
  };
@@ -95,7 +95,7 @@ export default uniComponent({
95
95
  dataChecked: 'setClass',
96
96
  icon: {
97
97
  handler(e) {
98
- this._icon = calcIcon(e);
98
+ this.innerIcon = calcIcon(e);
99
99
  },
100
100
  immediate: true,
101
101
  },
@@ -143,7 +143,4 @@ export default uniComponent({
143
143
  });
144
144
 
145
145
  </script>
146
- <style scoped>
147
- @import './check-tag.css';
148
-
149
- </style>
146
+ <style scoped src="./check-tag.css"></style>