@tdesign/uniapp 0.7.0 → 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 (111) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/action-sheet/README.en-US.md +1 -1
  3. package/dist/action-sheet/README.md +1 -1
  4. package/dist/action-sheet/action-sheet.vue +27 -12
  5. package/dist/action-sheet/computed.js +14 -0
  6. package/dist/action-sheet/type.ts +2 -2
  7. package/dist/avatar/avatar.vue +6 -6
  8. package/dist/avatar-group/avatar-group.vue +1 -3
  9. package/dist/back-top/back-top.vue +13 -15
  10. package/dist/badge/badge.vue +1 -3
  11. package/dist/button/README.en-US.md +5 -2
  12. package/dist/button/README.md +5 -2
  13. package/dist/button/button.vue +18 -14
  14. package/dist/button/props.ts +14 -0
  15. package/dist/button/type.ts +14 -0
  16. package/dist/calendar/README.en-US.md +1 -0
  17. package/dist/calendar/README.md +1 -0
  18. package/dist/calendar/calendar-header.vue +1 -3
  19. package/dist/calendar/calendar.vue +28 -19
  20. package/dist/calendar/props.ts +5 -0
  21. package/dist/calendar/template.vue +1 -3
  22. package/dist/calendar/type.ts +6 -0
  23. package/dist/cascader/cascader.vue +9 -7
  24. package/dist/cell/cell.vue +51 -35
  25. package/dist/cell-group/cell-group.vue +1 -3
  26. package/dist/check-tag/check-tag.vue +12 -15
  27. package/dist/checkbox/checkbox.vue +13 -15
  28. package/dist/col/col.vue +1 -3
  29. package/dist/collapse/collapse.vue +1 -3
  30. package/dist/collapse-panel/collapse-panel.vue +1 -3
  31. package/dist/color-picker/color-picker.vue +2 -4
  32. package/dist/color-picker/template.vue +1 -3
  33. package/dist/common/src/instantiationDecorator.js +14 -0
  34. package/dist/common/style/theme/index.css +42 -90
  35. package/dist/count-down/count-down.vue +2 -4
  36. package/dist/date-time-picker/date-time-picker.vue +1 -3
  37. package/dist/dialog/dialog.vue +67 -69
  38. package/dist/divider/divider.vue +1 -3
  39. package/dist/draggable/draggable.vue +1 -3
  40. package/dist/drawer/drawer.vue +1 -3
  41. package/dist/dropdown-item/dropdown-item.vue +1 -3
  42. package/dist/dropdown-menu/dropdown-menu.vue +12 -14
  43. package/dist/empty/empty.vue +1 -3
  44. package/dist/fab/fab.vue +1 -3
  45. package/dist/footer/footer.vue +1 -3
  46. package/dist/form/form.vue +1 -3
  47. package/dist/form-item/form-item.css +16 -11
  48. package/dist/form-item/form-item.vue +2 -7
  49. package/dist/grid/grid.vue +1 -3
  50. package/dist/grid-item/grid-item.vue +3 -5
  51. package/dist/guide/content.vue +1 -3
  52. package/dist/guide/guide.vue +25 -40
  53. package/dist/icon/icon.vue +2 -4
  54. package/dist/image/image.vue +1 -3
  55. package/dist/image-viewer/image-viewer.vue +27 -30
  56. package/dist/indexes/indexes.vue +13 -15
  57. package/dist/indexes-anchor/indexes-anchor.vue +1 -3
  58. package/dist/input/input.vue +31 -31
  59. package/dist/link/link.vue +25 -26
  60. package/dist/loading/loading.vue +2 -2
  61. package/dist/message/index.d.ts +1 -1
  62. package/dist/message/message.interface.ts +2 -1
  63. package/dist/message-item/message-item.vue +34 -36
  64. package/dist/mixins/page-scroll.js +1 -1
  65. package/dist/navbar/navbar.vue +46 -33
  66. package/dist/notice-bar/notice-bar.vue +24 -26
  67. package/dist/overlay/overlay.vue +5 -7
  68. package/dist/picker/picker.vue +3 -4
  69. package/dist/picker-item/picker-item.vue +2 -4
  70. package/dist/popover/popover.vue +1 -3
  71. package/dist/popup/popup.vue +2 -4
  72. package/dist/progress/progress.vue +1 -3
  73. package/dist/pull-down-refresh/pull-down-refresh.vue +13 -15
  74. package/dist/qrcode/components/qrcode-canvas/qrcode-canvas.vue +1 -3
  75. package/dist/qrcode/components/qrcode-status/qrcode-status.vue +1 -3
  76. package/dist/qrcode/qrcode.vue +1 -3
  77. package/dist/radio/radio.vue +20 -22
  78. package/dist/rate/rate.vue +1 -3
  79. package/dist/result/result.vue +13 -15
  80. package/dist/row/row.vue +1 -3
  81. package/dist/search/README.en-US.md +1 -1
  82. package/dist/search/README.md +1 -1
  83. package/dist/search/search.vue +22 -10
  84. package/dist/search/type.ts +1 -1
  85. package/dist/side-bar/side-bar.vue +1 -3
  86. package/dist/side-bar-item/side-bar-item.vue +12 -15
  87. package/dist/skeleton/skeleton.vue +2 -4
  88. package/dist/slider/slider.vue +18 -20
  89. package/dist/step-item/step-item.vue +1 -3
  90. package/dist/stepper/stepper.vue +1 -3
  91. package/dist/steps/steps.vue +1 -2
  92. package/dist/sticky/sticky.vue +1 -3
  93. package/dist/swipe-cell/swipe-cell.vue +2 -5
  94. package/dist/swiper/swiper.vue +1 -3
  95. package/dist/swiper-nav/swiper-nav.vue +1 -3
  96. package/dist/switch/switch.vue +1 -3
  97. package/dist/tab-bar/tab-bar.vue +2 -1
  98. package/dist/tab-bar-item/tab-bar-item.vue +22 -25
  99. package/dist/tab-panel/tab-panel.vue +1 -3
  100. package/dist/tabs/tabs.vue +1 -2
  101. package/dist/tag/tag.vue +23 -26
  102. package/dist/textarea/textarea.vue +1 -3
  103. package/dist/toast/toast.vue +12 -14
  104. package/dist/transition/transition.vue +1 -3
  105. package/dist/tree-select/tree-select.vue +6 -9
  106. package/dist/upload/props.ts +1 -1
  107. package/dist/upload/upload.vue +1 -3
  108. package/dist/watermark/watermark.vue +1 -2
  109. package/package.json +3 -1
  110. package/dist/.eslintrc.js +0 -30
  111. package/dist/tsconfig.eslint.json +0 -13
@@ -24,20 +24,20 @@
24
24
  <view :class="classPrefix + '__prefix-icon ' + tClassPrefixIcon">
25
25
  <slot name="prefix-icon" />
26
26
  <block
27
- v-if="_prefixIcon"
27
+ v-if="iPrefixIcon"
28
28
  name="icon"
29
29
  >
30
30
  <t-icon
31
- :custom-style="_prefixIcon.style || ''"
32
- :t-class="_prefixIcon.tClass"
33
- :prefix="_prefixIcon.prefix"
34
- :name="_prefixIcon.name"
35
- :size="_prefixIcon.size"
36
- :color="_prefixIcon.color"
31
+ :custom-style="iPrefixIcon.style || ''"
32
+ :t-class="iPrefixIcon.tClass"
33
+ :prefix="iPrefixIcon.prefix"
34
+ :name="iPrefixIcon.name"
35
+ :size="iPrefixIcon.size"
36
+ :color="iPrefixIcon.color"
37
37
  :aria-hidden="true"
38
- :aria-label="_prefixIcon.ariaLabel"
39
- :aria-role="_prefixIcon.arialRole"
40
- @click="_suffixIcon.click || ''"
38
+ :aria-label="iPrefixIcon.ariaLabel"
39
+ :aria-role="iPrefixIcon.arialRole"
40
+ @click="iSuffixIcon.click || ''"
41
41
  />
42
42
  </block>
43
43
  </view>
@@ -51,20 +51,20 @@
51
51
  <view :class="classPrefix + '__suffix-icon ' + tClassSuffixIcon">
52
52
  <slot name="suffix-icon" />
53
53
  <block
54
- v-if="_suffixIcon"
54
+ v-if="iSuffixIcon"
55
55
  name="icon"
56
56
  >
57
57
  <t-icon
58
- :custom-style="_suffixIcon.style || ''"
59
- :t-class="_suffixIcon.tClass"
60
- :prefix="_suffixIcon.prefix || ''"
61
- :name="_suffixIcon.name"
62
- :size="_suffixIcon.size"
63
- :color="_suffixIcon.color"
58
+ :custom-style="iSuffixIcon.style || ''"
59
+ :t-class="iSuffixIcon.tClass"
60
+ :prefix="iSuffixIcon.prefix || ''"
61
+ :name="iSuffixIcon.name"
62
+ :size="iSuffixIcon.size"
63
+ :color="iSuffixIcon.color"
64
64
  :aria-hidden="true"
65
- :aria-label="_suffixIcon.ariaLabel"
66
- :aria-role="_suffixIcon.arialRole"
67
- @click="_suffixIcon.click || ''"
65
+ :aria-label="iSuffixIcon.ariaLabel"
66
+ :aria-role="iSuffixIcon.arialRole"
67
+ @click="iSuffixIcon.click || ''"
68
68
  />
69
69
  </block>
70
70
  </view>
@@ -105,21 +105,21 @@ export default uniComponent({
105
105
  prefix,
106
106
  classPrefix: name,
107
107
  tools,
108
- _prefixIcon: null,
109
- _suffixIcon: null,
108
+ iPrefixIcon: null,
109
+ iSuffixIcon: null,
110
110
  className: '',
111
111
  };
112
112
  },
113
113
  watch: {
114
114
  prefixIcon: {
115
115
  handler(value) {
116
- this._prefixIcon = calcIcon(value);
116
+ this.iPrefixIcon = calcIcon(value);
117
117
  },
118
118
  immediate: true,
119
119
  },
120
120
  suffixIcon: {
121
121
  handler(value) {
122
- this._suffixIcon = calcIcon(value);
122
+ this.iSuffixIcon = calcIcon(value);
123
123
  },
124
124
  immediate: true,
125
125
  },
@@ -163,9 +163,8 @@ export default uniComponent({
163
163
  },
164
164
  });
165
165
  </script>
166
+ <style scoped src="./link.css"></style>
166
167
  <style scoped>
167
- @import './link.css';
168
-
169
168
  /* #ifdef H5 */
170
169
  :deep(.navigator-wrap) {
171
170
  display: flex;
@@ -142,7 +142,7 @@ export default uniComponent({
142
142
  immediate: true,
143
143
  },
144
144
  },
145
- beforeUnMount() {
145
+ beforeUnmount() {
146
146
  clearTimeout(this.timer);
147
147
  },
148
148
  methods: {
@@ -153,5 +153,5 @@ export default uniComponent({
153
153
  });
154
154
 
155
155
  </script>
156
- <style src="./loading.css" scoped>
156
+ <style src="./loading.css" scoped>
157
157
  </style>
@@ -1,7 +1,7 @@
1
1
  import { MessageProps } from './message.interface';
2
2
  declare type Context = any;
3
3
  declare type Instance = any;
4
- interface MessageActionOptionsType extends Optional<MessageProps> {
4
+ interface MessageActionOptionsType extends Partial<MessageProps> {
5
5
  context?: Context;
6
6
  selector?: string;
7
7
  }
@@ -1,3 +1,4 @@
1
+ import type { TdMessageProps } from './type';
1
2
 
2
3
  export const MessageType = {
3
4
  info: 'info',
@@ -21,7 +22,7 @@ export interface MessageProps {
21
22
  closeBtn?: boolean;
22
23
  action?: string;
23
24
  marquee?: MessageMarquee;
24
- offset?: object;
25
+ offset?: TdMessageProps['offset'];
25
26
  duration?: number;
26
27
  zIndex?: number;
27
28
  id?: string;
@@ -12,19 +12,19 @@
12
12
  <view :class="classPrefix + '__icon--left'">
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"
21
+ :prefix="innerIcon.prefix"
22
+ :name="innerIcon.name"
23
+ :size="innerIcon.size"
24
+ :color="innerIcon.color"
25
25
  :aria-hidden="true"
26
- :aria-label="_icon.ariaLabel"
27
- :aria-role="_icon.ariaRole"
26
+ :aria-label="innerIcon.ariaLabel"
27
+ :aria-role="innerIcon.ariaRole"
28
28
  />
29
29
  </block>
30
30
  </view>
@@ -48,18 +48,18 @@
48
48
  </view>
49
49
  </view>
50
50
  <t-link
51
- v-if="_link && _link.content"
51
+ v-if="innerLink && innerLink.content"
52
52
  :t-class="classPrefix + '__link ' + tClassLink"
53
- :custom-style="tools._style([_link.style, _link.customStyle])"
54
- :disabled="_link.disabled || false"
55
- :hover="_link.hover || true"
56
- :theme="_link.theme || 'primary'"
57
- :size="_link.size || 'medium'"
58
- :prefix-icon="_link.prefixIcon || ''"
59
- :suffix-icon="_link.suffixIcon || ''"
60
- :underline="_link.underline || false"
61
- :content="_link.content || ''"
62
- :navigator-props="_link.navigatorProps || null"
53
+ :custom-style="tools._style([innerLink.style, innerLink.customStyle])"
54
+ :disabled="innerLink.disabled || false"
55
+ :hover="innerLink.hover || true"
56
+ :theme="innerLink.theme || 'primary'"
57
+ :size="innerLink.size || 'medium'"
58
+ :prefix-icon="innerLink.prefixIcon || ''"
59
+ :suffix-icon="innerLink.suffixIcon || ''"
60
+ :underline="innerLink.underline || false"
61
+ :content="innerLink.content || ''"
62
+ :navigator-props="innerLink.navigatorProps || null"
63
63
  @complete="handleLinkClick"
64
64
  />
65
65
  <slot name="link" />
@@ -69,19 +69,19 @@
69
69
  >
70
70
  <slot name="close-btn" />
71
71
  <block
72
- v-if="_closeBtn"
72
+ v-if="iCloseBtn"
73
73
  name="icon"
74
74
  >
75
75
  <t-icon
76
- :custom-style="_closeBtn.style || ''"
76
+ :custom-style="iCloseBtn.style || ''"
77
77
  :t-class="tClassCloseBtn"
78
- :prefix="_closeBtn.prefix"
79
- :name="_closeBtn.name"
80
- :size="_closeBtn.size"
81
- :color="_closeBtn.color"
78
+ :prefix="iCloseBtn.prefix"
79
+ :name="iCloseBtn.name"
80
+ :size="iCloseBtn.size"
81
+ :color="iCloseBtn.color"
82
82
  :aria-hidden="false"
83
- :aria-label="_closeBtn.ariaLabel || '关闭'"
84
- :aria-role="_closeBtn.ariaRole || 'button'"
83
+ :aria-label="iCloseBtn.ariaLabel || '关闭'"
84
+ :aria-role="iCloseBtn.ariaRole || 'button'"
85
85
  />
86
86
  </block>
87
87
  </view>
@@ -173,13 +173,13 @@ export default uniComponent({
173
173
  watch: {
174
174
  theme: {
175
175
  handler(theme) {
176
- this._icon = calcIcon(this.icon, THEME_ICON[theme]);
176
+ this.innerIcon = calcIcon(this.icon, THEME_ICON[theme]);
177
177
  },
178
178
  immediate: true,
179
179
  },
180
180
  icon: {
181
181
  handler(icon) {
182
- this._icon = calcIcon(icon, THEME_ICON[this.theme]);
182
+ this.innerIcon = calcIcon(icon, THEME_ICON[this.theme]);
183
183
  },
184
184
  immediate: true,
185
185
  },
@@ -187,15 +187,15 @@ export default uniComponent({
187
187
 
188
188
  link: {
189
189
  handler(v) {
190
- const _link = isObject(v) ? { ...v } : { content: v };
191
- this._link = _link;
190
+ const innerLink = isObject(v) ? { ...v } : { content: v };
191
+ this.innerLink = innerLink;
192
192
  },
193
193
  immediate: true,
194
194
  },
195
195
 
196
196
  closeBtn: {
197
197
  handler(v) {
198
- this._closeBtn = calcIcon(v, 'close');
198
+ this.iCloseBtn = calcIcon(v, 'close');
199
199
  },
200
200
  immediate: true,
201
201
  },
@@ -203,7 +203,7 @@ export default uniComponent({
203
203
  mounted() {
204
204
  this.memoInitialData();
205
205
  },
206
- beforeUnMount() {
206
+ beforeUnmount() {
207
207
  this.clearMessageAnimation();
208
208
  },
209
209
  methods: {
@@ -348,6 +348,4 @@ export default uniComponent({
348
348
  },
349
349
  });
350
350
  </script>
351
- <style scoped>
352
- @import './message-item.css';
353
- </style>
351
+ <style scoped src="./message-item.css"></style>
@@ -53,7 +53,7 @@ export default (funcName = 'onScroll', useBus = true) => {
53
53
  page.onPageScroll = onPageScroll;
54
54
  },
55
55
 
56
- beforeUnMount() {
56
+ beforeUnmount() {
57
57
  if (useBus) {
58
58
  bus.off(PAGE_SCROLL_EVENT_NAME, this[funcName]);
59
59
  return;
@@ -49,7 +49,7 @@
49
49
  <script>
50
50
  import TIcon from '../icon/icon';
51
51
  import { uniComponent } from '../common/src/index';
52
- import { getRect, systemInfo } from '../common/utils';
52
+ import { getRect, getWindowInfo } from '../common/utils';
53
53
  import { prefix } from '../common/config';
54
54
  import props from './props';
55
55
  import tools from '../common/utils.wxs';
@@ -61,7 +61,7 @@ const BASE_MENU_RECT = {
61
61
  width: 87,
62
62
  height: 32,
63
63
  top: 24,
64
- right: systemInfo.windowWidth - 10,
64
+ right: 10, // 距离右侧的间距,实际 right 值在 getMenuRect 中动态计算
65
65
  };
66
66
 
67
67
 
@@ -104,9 +104,9 @@ export default uniComponent({
104
104
  showTitle: '',
105
105
  hideLeft: false,
106
106
  hideCenter: false,
107
- _menuRect: null,
108
- _leftRect: null,
109
- _boxStyle: {},
107
+ iMenuRect: null,
108
+ iLeftRect: null,
109
+ iBoxStyle: {},
110
110
  tools,
111
111
 
112
112
  visibleClass: '',
@@ -143,32 +143,43 @@ export default uniComponent({
143
143
  this.initStyle();
144
144
  this.getLeftRect();
145
145
  this.onMenuButtonBoundingClientRectWeightChange();
146
+
147
+ this.onWindowResizeCallback = () => {
148
+ this.initStyle();
149
+ this.getLeftRect();
150
+ };
151
+ uni.onWindowResize(this.onWindowResizeCallback);
146
152
  },
147
153
 
148
- beforeUnMount() {
154
+ beforeUnmount() {
149
155
  this.offMenuButtonBoundingClientRectWeightChange();
156
+ if (this.onWindowResizeCallback) {
157
+ uni.offWindowResize(this.onWindowResizeCallback);
158
+ }
150
159
  },
151
160
  methods: {
152
161
  initStyle() {
153
- this.getMenuRect();
162
+ // 每次重新获取最新的窗口信息,避免 H5 下窗口大小变化后使用缓存值
163
+ const windowInfo = getWindowInfo();
164
+ this.getMenuRect(windowInfo);
154
165
 
155
- const { _menuRect, _leftRect } = this;
166
+ const { iMenuRect, iLeftRect } = this;
156
167
 
157
- if (!_menuRect || !_leftRect || !systemInfo) return;
168
+ if (!iMenuRect || !iLeftRect || !windowInfo) return;
158
169
 
159
- const _boxStyle = {
160
- '--td-navbar-padding-top': `${systemInfo.statusBarHeight}px`,
161
- '--td-navbar-right': `${systemInfo.windowWidth - _menuRect.left}px`, // 导航栏右侧小程序胶囊按钮宽度
162
- '--td-navbar-left-max-width': `${_menuRect.left}px`, // 左侧内容最大宽度
163
- '--td-navbar-capsule-height': `${_menuRect.height}px`, // 胶囊高度
164
- '--td-navbar-capsule-width': `${_menuRect.width}px`, // 胶囊宽度
165
- '--td-navbar-height': `${(_menuRect.top - systemInfo.statusBarHeight) * 2 + _menuRect.height}px`,
170
+ const iBoxStyle = {
171
+ '--td-navbar-padding-top': `${windowInfo.statusBarHeight}px`,
172
+ '--td-navbar-right': `${windowInfo.windowWidth - iMenuRect.left}px`, // 导航栏右侧小程序胶囊按钮宽度
173
+ '--td-navbar-left-max-width': `${iMenuRect.left}px`, // 左侧内容最大宽度
174
+ '--td-navbar-capsule-height': `${iMenuRect.height}px`, // 胶囊高度
175
+ '--td-navbar-capsule-width': `${iMenuRect.width}px`, // 胶囊宽度
176
+ '--td-navbar-height': `${(iMenuRect.top - windowInfo.statusBarHeight) * 2 + iMenuRect.height}px`,
166
177
  };
167
178
  // #ifdef H5 || APP-PLUS
168
- delete _boxStyle['--td-navbar-height'];
179
+ delete iBoxStyle['--td-navbar-height'];
169
180
  // #endif
170
181
 
171
- this.calcCenterStyle(_leftRect, _menuRect, _boxStyle);
182
+ this.calcCenterStyle(iLeftRect, iMenuRect, iBoxStyle, windowInfo);
172
183
  },
173
184
  onWatchTitle() {
174
185
  const { title } = this;
@@ -183,48 +194,52 @@ export default uniComponent({
183
194
  leftRect,
184
195
  menuRect,
185
196
  defaultStyle,
197
+ windowInfo,
186
198
  ) {
187
- const maxSpacing = Math.max(leftRect.right, systemInfo.windowWidth - menuRect.left);
188
- const _boxStyle = {
199
+ const curWindowInfo = windowInfo || getWindowInfo();
200
+ const maxSpacing = Math.max(leftRect.right, curWindowInfo.windowWidth - menuRect.left);
201
+ const iBoxStyle = {
189
202
  ...defaultStyle,
190
203
  'z-index': this.zIndex,
191
204
  '--td-navbar-center-left': `${maxSpacing}px`, // 标题左侧距离
192
205
  '--td-navbar-center-width': `${Math.max(menuRect.left - maxSpacing, 0)}px`, // 标题宽度
193
206
  };
194
207
 
195
- const boxStyle = Object.entries(_boxStyle)
208
+ const boxStyle = Object.entries(iBoxStyle)
196
209
  .map(([k, v]) => `${k}: ${v}`)
197
210
  .join('; ');
198
211
 
199
212
  this.boxStyle = boxStyle;
200
- this._boxStyle = _boxStyle;
213
+ this.iBoxStyle = iBoxStyle;
201
214
  },
202
215
 
203
216
  getLeftRect() {
204
217
  getRect(this, `.${name}__left`).then((res) => {
205
- if (res.right > this._leftRect.right) {
206
- this.calcCenterStyle(res, this._menuRect, this._boxStyle);
218
+ if (res.right > this.iLeftRect.right) {
219
+ this.calcCenterStyle(res, this.iMenuRect, this.iBoxStyle);
207
220
  }
208
221
  });
209
222
  },
210
223
 
211
- getMenuRect() {
224
+ getMenuRect(windowInfo) {
225
+ const curWindowInfo = windowInfo || getWindowInfo();
212
226
  // 场景值为1177(视频号直播间)和1175 (视频号profile页)时,小程序禁用了 uni.getMenuButtonBoundingClientRect
213
227
  let rect = {
214
228
  ...BASE_MENU_RECT,
229
+ right: curWindowInfo.windowWidth - BASE_MENU_RECT.right, // 动态计算,避免 H5 下缓存
215
230
  bottom: BASE_MENU_RECT.top + BASE_MENU_RECT.height,
216
- left: BASE_MENU_RECT.right - BASE_MENU_RECT.width,
231
+ left: curWindowInfo.windowWidth - BASE_MENU_RECT.right - BASE_MENU_RECT.width,
217
232
  };
218
233
  if (uni.getMenuButtonBoundingClientRect
219
234
  && typeof uni.getMenuButtonBoundingClientRect === 'function'
220
- && typeof uni.getMenuButtonBoundingClientRect() === 'object'
235
+ && typeof uni.getMenuButtonBoundingClientRect() === 'object'
221
236
  ) {
222
237
  rect = uni.getMenuButtonBoundingClientRect() || {};
223
238
  }
224
239
 
225
- this._menuRect = rect;
226
- this._leftRect = {
227
- right: systemInfo.windowWidth - rect.left,
240
+ this.iMenuRect = rect;
241
+ this.iLeftRect = {
242
+ right: curWindowInfo.windowWidth - rect.left,
228
243
  };
229
244
  },
230
245
 
@@ -288,6 +303,4 @@ export default uniComponent({
288
303
  },
289
304
  });
290
305
  </script>
291
- <style scoped>
292
- @import './navbar.css';
293
- </style>
306
+ <style scoped src="./navbar.css"></style>
@@ -13,20 +13,20 @@
13
13
  >
14
14
  <slot name="prefix-icon" />
15
15
  <block
16
- v-if="_prefixIcon"
16
+ v-if="iPrefixIcon"
17
17
  name="icon"
18
18
  >
19
19
  <t-icon
20
- :custom-style="_prefixIcon.style || ''"
20
+ :custom-style="iPrefixIcon.style || ''"
21
21
  :t-class="tClassPrefixIcon"
22
- :prefix="_prefixIcon.prefix"
23
- :name="_prefixIcon.name"
24
- :size="_prefixIcon.size"
25
- :color="_prefixIcon.color"
26
- :aria-hidden="!!_prefixIcon.ariaHidden"
27
- :aria-label="_prefixIcon.ariaLabel"
28
- :aria-role="_prefixIcon.ariaRole"
29
- @click="_prefixIcon.bindclick || ''"
22
+ :prefix="iPrefixIcon.prefix"
23
+ :name="iPrefixIcon.name"
24
+ :size="iPrefixIcon.size"
25
+ :color="iPrefixIcon.color"
26
+ :aria-hidden="!!iPrefixIcon.ariaHidden"
27
+ :aria-label="iPrefixIcon.ariaLabel"
28
+ :aria-role="iPrefixIcon.ariaRole"
29
+ @click="iPrefixIcon.bindclick || ''"
30
30
  />
31
31
  </block>
32
32
  </view>
@@ -82,20 +82,20 @@
82
82
  >
83
83
  <slot name="suffix-icon" />
84
84
  <block
85
- v-if="_suffixIcon"
85
+ v-if="iSuffixIcon"
86
86
  name="icon"
87
87
  >
88
88
  <t-icon
89
- :custom-style="_suffixIcon.style || ''"
89
+ :custom-style="iSuffixIcon.style || ''"
90
90
  :t-class="tClassSuffixIcon"
91
- :prefix="_suffixIcon.prefix"
92
- :name="_suffixIcon.name"
93
- :size="_suffixIcon.size"
94
- :color="_suffixIcon.color"
95
- :aria-hidden="!!_suffixIcon.ariaHidden"
96
- :aria-label="_suffixIcon.ariaLabel"
97
- :aria-role="_suffixIcon.ariaRole"
98
- @click="_suffixIcon.bindclick || ''"
91
+ :prefix="iSuffixIcon.prefix"
92
+ :name="iSuffixIcon.name"
93
+ :size="iSuffixIcon.size"
94
+ :color="iSuffixIcon.color"
95
+ :aria-hidden="!!iSuffixIcon.ariaHidden"
96
+ :aria-label="iSuffixIcon.ariaLabel"
97
+ :aria-role="iSuffixIcon.ariaRole"
98
+ @click="iSuffixIcon.bindclick || ''"
99
99
  />
100
100
  </block>
101
101
  </view>
@@ -185,7 +185,7 @@ export default uniComponent({
185
185
 
186
186
  suffixIcon: {
187
187
  handler(v) {
188
- this._suffixIcon = calcIcon(v);
188
+ this.iSuffixIcon = calcIcon(v);
189
189
  },
190
190
  immediate: true,
191
191
  },
@@ -209,7 +209,7 @@ export default uniComponent({
209
209
  this.show();
210
210
  this.__ready = true;
211
211
  },
212
- beforeUnMount() {
212
+ beforeUnmount() {
213
213
  this.clearNoticeBarAnimation();
214
214
  },
215
215
  methods: {
@@ -295,7 +295,7 @@ export default uniComponent({
295
295
 
296
296
  setPrefixIcon(v) {
297
297
  const { theme } = this;
298
- this._prefixIcon = calcIcon(v, THEME_ICON[theme]);
298
+ this.iPrefixIcon = calcIcon(v, THEME_ICON[theme]);
299
299
  },
300
300
 
301
301
  onChange(e) {
@@ -321,6 +321,4 @@ export default uniComponent({
321
321
  },
322
322
  });
323
323
  </script>
324
- <style scoped>
325
- @import './notice-bar.css';
326
- </style>
324
+ <style scoped src="./notice-bar.css"></style>
@@ -5,7 +5,7 @@
5
5
  :class="prefix + '-overlay ' + transitionClass"
6
6
  :style="tools._style([
7
7
  '--td-overlay-transition-duration:' + duration + 'ms',
8
- 'z-index:' + _zIndex, 'top:' + distanceTop + 'px',
8
+ 'z-index:' + iZIndex, 'top:' + distanceTop + 'px',
9
9
  computedStyle,
10
10
  customStyle
11
11
  ])"
@@ -22,7 +22,7 @@
22
22
  v-else-if="realVisible"
23
23
  :class="prefix + '-overlay ' + transitionClass "
24
24
  :style="tools._style([
25
- 'z-index:' + _zIndex,
25
+ 'z-index:' + iZIndex,
26
26
  'top:' + distanceTop + 'px',
27
27
  computedStyle,
28
28
  customStyle
@@ -69,7 +69,7 @@ export default uniComponent({
69
69
  prefix,
70
70
  classPrefix: name,
71
71
  computedStyle: '',
72
- _zIndex: 11000,
72
+ iZIndex: 11000,
73
73
  tools,
74
74
  };
75
75
  },
@@ -83,7 +83,7 @@ export default uniComponent({
83
83
  zIndex: {
84
84
  handler(v) {
85
85
  if (v !== 0) {
86
- this._zIndex = v;
86
+ this.iZIndex = v;
87
87
  }
88
88
  },
89
89
  immediate: true,
@@ -100,6 +100,4 @@ export default uniComponent({
100
100
  },
101
101
  });
102
102
  </script>
103
- <style scoped>
104
- @import './overlay.css';
105
- </style>
103
+ <style scoped src="./overlay.css"></style>
@@ -9,7 +9,7 @@
9
9
  :using-custom-navbar="usingCustomNavbar || (popupProps && popupProps.usingCustomNavbar)"
10
10
  :custom-navbar-height="coalesce(customNavbarHeight, popupProps && popupProps.usingCustomNavbar)"
11
11
  :z-index="(popupProps && popupProps.zIndex) || defaultPopUpzIndex"
12
- :overlay-props="(popupProps && popupProps.overlayProps) || defaultPopUpProps"
12
+ :overlay-props="(popupProps && popupProps.overlayProps) || defaultOverlayProps"
13
13
  @visible-change="onPopupChange"
14
14
  >
15
15
  <template #content>
@@ -147,7 +147,7 @@ export default uniComponent({
147
147
  return {
148
148
  prefix,
149
149
  classPrefix: name,
150
- defaultPopUpProps: {},
150
+ defaultOverlayProps: {},
151
151
  defaultPopUpzIndex: 11500,
152
152
  indicatorTop: 72, // 默认indicator位置,会动态计算
153
153
 
@@ -302,9 +302,8 @@ export default uniComponent({
302
302
  },
303
303
  });
304
304
  </script>
305
+ <style scoped src="./picker.css"></style>
305
306
  <style scoped>
306
- @import './picker.css';
307
-
308
307
  /* #ifndef MP-WEIXIN */
309
308
  /* 适配 qq 小程序等 */
310
309
  :deep(t-picker-item) {
@@ -185,7 +185,7 @@ export default uniComponent({
185
185
 
186
186
  },
187
187
 
188
- beforeUnMount() {
188
+ beforeUnmount() {
189
189
  // 清理定时器,防止内存泄漏
190
190
  if (this._animationTimer) {
191
191
  clearInterval(this._animationTimer);
@@ -441,6 +441,4 @@ export default uniComponent({
441
441
  },
442
442
  });
443
443
  </script>
444
- <style scoped>
445
- @import './picker-item.css';
446
- </style>
444
+ <style scoped src="./picker-item.css"></style>
@@ -347,6 +347,4 @@ export default uniComponent({
347
347
 
348
348
 
349
349
  </script>
350
- <style scoped>
351
- @import './popover.css';
352
- </style>
350
+ <style scoped src="./popover.css"></style>
@@ -58,7 +58,7 @@
58
58
  :using-custom-navbar="usingCustomNavbar"
59
59
  :custom-navbar-height="customNavbarHeight"
60
60
  :z-index="(overlayProps && overlayProps.zIndex) || 11000"
61
- :duration="(overlayProps && overlayProps.duration) || 300"
61
+ :duration="(overlayProps && overlayProps.duration) || duration || 300"
62
62
  :background-color="(overlayProps && overlayProps.backgroundColor) || ''"
63
63
  :prevent-scroll-through="preventScrollThrough || (overlayProps ? !!overlayProps.preventScrollThrough : false)"
64
64
  :custom-style="(overlayProps && overlayProps.style) || ''"
@@ -136,6 +136,4 @@ export default uniComponent({
136
136
  });
137
137
 
138
138
  </script>
139
- <style scoped>
140
- @import './popup.css';
141
- </style>
139
+ <style scoped src="./popup.css"></style>
@@ -254,6 +254,4 @@ export default uniComponent({
254
254
  },
255
255
  });
256
256
  </script>
257
- <style scoped>
258
- @import './progress.css';
259
- </style>
257
+ <style scoped src="./progress.css"></style>