@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
package/CHANGELOG.md CHANGED
@@ -5,6 +5,28 @@ 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
+
21
+ ## 🌈 0.7.1 `2026-02-04`
22
+
23
+ ### 🚀 Features
24
+
25
+ - `ActionSheet`: 为 `items` 子项的 `icon` 字段新增 `object` 类型,支持透传到 `TIcon` 组件 @novlan1 ([#4255](https://github.com/Tencent/tdesign-miniprogram/pull/4255))
26
+ - `Button`: 新增 `activity-type`,`entrance-path` 和 `need-show-entrance` 属性 @novlan1 ([#4255](https://github.com/Tencent/tdesign-miniprogram/pull/4255))
27
+ - `Icon`: 新增 217 个与人工智能、文档、徽标和文件相关的图标 @novlan1 ([#4255](https://github.com/Tencent/tdesign-miniprogram/pull/4255))
28
+ - `Search`: 为 `change` 事件新增 `trigger` 参数,表示触发源 @novlan1 ([#4255](https://github.com/Tencent/tdesign-miniprogram/pull/4255))
29
+
8
30
  ## 🌈 0.7.0 `2026-01-30`
9
31
 
10
32
  ### 🚀 Features
@@ -11,7 +11,7 @@ align | String | center | options: center/left | N
11
11
  cancel-text | String | - | \- | N
12
12
  count | Number | 8 | \- | N
13
13
  description | String | - | \- | N
14
- items | Array | [] | Typescript: `Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; description?: string; color?: string; disabled?: boolean; icon?: string; suffixIcon?: string }`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/action-sheet/type.ts) | N
14
+ items | Array | [] | Typescript: `Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; description?: string; color?: string; disabled?: boolean; icon?: string \| object; suffixIcon?: string \| object }`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/action-sheet/type.ts) | N
15
15
  popup-props | Object | {} | Typescript: `PopupProps`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/action-sheet/type.ts) | N
16
16
  show-cancel | Boolean | true | \- | N
17
17
  show-overlay | Boolean | true | \- | N
@@ -82,7 +82,7 @@ align | String | center | 水平对齐方式。可选项:center/left | N
82
82
  cancel-text | String | - | 设置取消按钮的文本 | N
83
83
  count | Number | 8 | 设置每页展示菜单的数量,仅当 type=grid 时有效 | N
84
84
  description | String | - | 动作面板描述文字 | N
85
- items | Array | [] | 菜单项。TS 类型:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; description?: string; color?: string; disabled?: boolean; icon?: string; suffixIcon?: string }`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/action-sheet/type.ts) | N
85
+ items | Array | [] | 菜单项。TS 类型:`Array<string \| ActionSheetItem>` `interface ActionSheetItem { label: string; description?: string; color?: string; disabled?: boolean; icon?: string \| object; suffixIcon?: string \| object }`。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/action-sheet/type.ts) | N
86
86
  popup-props | Object | {} | 透传 Popup 组件全部属性。TS 类型:`PopupProps`,[Popup API Documents](./popup?tab=api)。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/action-sheet/type.ts) | N
87
87
  show-cancel | Boolean | true | 是否显示取消按钮 | N
88
88
  show-overlay | Boolean | true | 是否显示遮罩层 | N
@@ -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
@@ -25,6 +25,7 @@
25
25
  >
26
26
  {{ dataDescription }}
27
27
  </view>
28
+
28
29
  <block v-if="gridThemeItems.length">
29
30
  <block v-if="gridThemeItems.length === 1">
30
31
  <t-grid
@@ -38,7 +39,7 @@
38
39
  :key="index"
39
40
  :t-class="classPrefix + '__grid-item ' + classPrefix + '__square'"
40
41
  :data-index="index"
41
- :icon="{ name: item.icon, color: item.color }"
42
+ :icon="{ color: item.color, ...getIconData(item.icon) }"
42
43
  :text="item.label || ''"
43
44
  :description="item.description || ''"
44
45
  :image="item.image || ''"
@@ -47,6 +48,7 @@
47
48
  />
48
49
  </t-grid>
49
50
  </block>
51
+
50
52
  <block v-else-if="gridThemeItems.length > 1">
51
53
  <view :class="classPrefix + '__swiper-wrap'">
52
54
  <swiper
@@ -71,7 +73,7 @@
71
73
  :t-class="classPrefix + '__grid-item'"
72
74
  :class="classPrefix + '__square'"
73
75
  :data-index="index"
74
- :icon="{ name: item.icon, color: item.color }"
76
+ :icon="{ color: item.color, ...getIconData(item.icon) }"
75
77
  :text="item.label || ''"
76
78
  :description="item.description || ''"
77
79
  :image="item.image || ''"
@@ -93,6 +95,7 @@
93
95
  </view>
94
96
  </block>
95
97
  </block>
98
+
96
99
  <view
97
100
  v-else-if="dataItems && dataItems.length"
98
101
  :class="classPrefix + '__list'"
@@ -112,8 +115,14 @@
112
115
  >
113
116
  <view :class="classPrefix + '__list-item-content'">
114
117
  <t-icon
115
- v-if="item.icon"
116
- :name="item.icon"
118
+ v-if="getIconData(item.icon)"
119
+ :prefix="getIconData(item.icon).prefix"
120
+ :name="getIconData(item.icon).name"
121
+ :size="getIconData(item.icon).size"
122
+ :color="getIconData(item.icon).color"
123
+ :aria-hidden="getIconData(item.icon).ariaHidden"
124
+ :aria-label="getIconData(item.icon).ariaLabel"
125
+ :aria-role="getIconData(item.icon).ariaRole"
117
126
  :t-class="classPrefix + '__list-item-icon'"
118
127
  :custom-style="iconCustomStyle"
119
128
  />
@@ -121,8 +130,14 @@
121
130
  {{ item.label || item }}
122
131
  </view>
123
132
  <t-icon
124
- v-if="item.suffixIcon"
125
- :name="item.suffixIcon"
133
+ v-if="getIconData(item.suffixIcon)"
134
+ :prefix="getIconData(item.suffixIcon).prefix"
135
+ :name="getIconData(item.suffixIcon).name"
136
+ :size="getIconData(item.suffixIcon).size"
137
+ :color="getIconData(item.suffixIcon).color"
138
+ :aria-hidden="getIconData(item.suffixIcon).ariaHidden"
139
+ :aria-label="getIconData(item.suffixIcon).ariaLabel"
140
+ :aria-role="getIconData(item.suffixIcon).ariaRole"
126
141
  :t-class="classPrefix + '__list-item-icon ' + classPrefix + '__list-item-icon--suffix'"
127
142
  style="margin-left: auto;"
128
143
  :custom-style="suffixIconCustomStyle"
@@ -170,7 +185,7 @@ import props from './props';
170
185
  import useCustomNavbar from '../mixins/using-custom-navbar';
171
186
  import tools from '../common/utils.wxs';
172
187
  import { getFunctionalMixin } from '../common/functional/mixin';
173
-
188
+ import { getIconData } from './computed';
174
189
 
175
190
  const name = `${prefix}-action-sheet`;
176
191
 
@@ -209,7 +224,7 @@ export default uniComponent({
209
224
  classPrefix: name,
210
225
  gridThemeItems: [],
211
226
  currentSwiperIndex: 0,
212
- defaultPopUpProps: {},
227
+ defaultOverlayProps: {},
213
228
  defaultPopUpzIndex: 11500,
214
229
  tools,
215
230
 
@@ -257,6 +272,8 @@ export default uniComponent({
257
272
  this.splitGridThemeActions();
258
273
  },
259
274
 
275
+ getIconData,
276
+
260
277
  memoInitialData() {
261
278
  this.initialData = {
262
279
  };
@@ -345,6 +362,4 @@ export default uniComponent({
345
362
  });
346
363
  </script>
347
364
 
348
- <style scoped>
349
- @import './action-sheet.css';
350
- </style>
365
+ <style scoped src="./action-sheet.css"></style>
@@ -1,3 +1,5 @@
1
+ import utils from '../common/utils.wxs';
2
+
1
3
  export const getListThemeItemClass = function (props) {
2
4
  const { classPrefix } = props;
3
5
  const { item } = props;
@@ -9,6 +11,18 @@ export const getListThemeItemClass = function (props) {
9
11
  return classList.join(' ');
10
12
  };
11
13
 
14
+ export const getIconData = function (icon) {
15
+ if (utils.isString(icon)) {
16
+ return { name: icon };
17
+ }
18
+
19
+ if (utils.isNoEmptyObj(icon)) {
20
+ return icon;
21
+ }
22
+
23
+ return null;
24
+ };
25
+
12
26
  export const isImage = function (name) {
13
27
  return name.indexOf('/') !== -1;
14
28
  };
@@ -86,8 +86,8 @@ export interface ActionSheetItem {
86
86
  description?: string;
87
87
  color?: string;
88
88
  disabled?: boolean;
89
- icon?: string;
90
- suffixIcon?: string;
89
+ icon?: string | object;
90
+ suffixIcon?: string | object;
91
91
  }
92
92
 
93
93
  export type ActionSheetTriggerSource = 'overlay' | 'command' | 'select';
@@ -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>
@@ -72,11 +72,13 @@ For global import, configure it in `app.json` in the root directory of the minip
72
72
  name | type | default | description | required
73
73
  -- | -- | -- | -- | --
74
74
  custom-style | Object | - | CSS(Cascading Style Sheets) | N
75
+ activity-type | Number | - | \- | N
75
76
  app-parameter | String | - | \- | N
76
77
  block | Boolean | false | make button to be a block-level element | N
77
78
  content | String | - | button's children elements | N
78
- custom-dataset | String / Number / Boolean / Object / Array | {} | Typescript:`string \| number \| boolean \| object \| Array<string \| number \| boolean \| object>` | N
79
+ custom-dataset | String / Number / Boolean / Object / Array | {} | \- | N
79
80
  disabled | Boolean | undefined | disable the button, make it can not be clicked | N
81
+ entrance-path | String | - | \- | N
80
82
  ghost | Boolean | false | make background-color to be transparent | N
81
83
  hover-class | String | - | \- | N
82
84
  hover-start-time | Number | 20 | \- | N
@@ -85,7 +87,8 @@ hover-stop-propagation | Boolean | false | \- | N
85
87
  icon | String / Object | - | icon name | N
86
88
  lang | String | - | message language。options: en/zh_CN/zh_TW | N
87
89
  loading | Boolean | false | set button to be loading state | N
88
- loading-props | Object | {} | Typescript:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/button/type.ts) | N
90
+ loading-props | Object | {} | Typescript: `LoadingProps`,[Loading API Documents](./loading?tab=api)。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/button/type.ts) | N
91
+ need-show-entrance | Boolean | true | \- | N
89
92
  open-type | String | - | open type of button, [Miniprogram Button](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。options: contact/share/getPhoneNumber/getUserInfo/launchApp/openSetting/feedback/chooseAvatar/agreePrivacyAuthorization | N
90
93
  phone-number-no-quota-toast | Boolean | true | \- | N
91
94
  send-message-img | String | 截图 | \- | N
@@ -63,11 +63,13 @@ import TButton from '@tdesign/uniapp/button/button.vue';
63
63
  名称 | 类型 | 默认值 | 描述 | 必传
64
64
  -- | -- | -- | -- | --
65
65
  custom-style | Object | - | 自定义样式 | N
66
+ activity-type | Number | - | 卡片id。 `open-type` 的值设置为 `liveActivity` ,设置 `activity-type` 参数为 [notify_type](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html)。当用户点击 `button` 后,可以通过 `bindcreateliveactivity` 事件回调获取到 `code` | N
66
67
  app-parameter | String | - | 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 | N
67
68
  block | Boolean | false | 是否为块级元素 | N
68
69
  content | String | - | 按钮内容 | N
69
- custom-dataset | String / Number / Boolean / Object / Array | {} | 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取。TS 类型:`string \| number \| boolean \| object \| Array<string \| number \| boolean \| object>` | N
70
+ custom-dataset | String / Number / Boolean / Object / Array | {} | 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取 | N
70
71
  disabled | Boolean | undefined | 禁用状态。优先级:Button.disabled > Form.disabled | N
72
+ entrance-path | String | - | 从消息小程序入口打开小程序的路径,默认为聊天工具启动路径 | N
71
73
  ghost | Boolean | false | 是否为幽灵按钮(镂空按钮) | N
72
74
  hover-class | String | - | 指定按钮按下去的样式类,按钮不为加载或禁用状态时有效。当 `hover-class="none"` 时,没有点击态效果 | N
73
75
  hover-start-time | Number | 20 | 按住后多久出现点击态,单位毫秒 | N
@@ -76,7 +78,8 @@ hover-stop-propagation | Boolean | false | 指定是否阻止本节点的祖先
76
78
  icon | String / Object | - | 图标名称。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon` | N
77
79
  lang | String | - | 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。<br />具体释义:<br />`en` 英文;<br />`zh_CN` 简体中文;<br />`zh_TW` 繁体中文。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。可选项:en/zh_CN/zh_TW | N
78
80
  loading | Boolean | false | 是否显示为加载状态 | N
79
- loading-props | Object | {} | 透传 Loading 组件全部属性。TS 类型:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/button/type.ts) | N
81
+ loading-props | Object | {} | 透传 Loading 组件全部属性。TS 类型:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/button/type.ts) | N
82
+ need-show-entrance | Boolean | true | 转发的文本消息是否要带小程序入口 | N
80
83
  open-type | String | - | 微信开放能力。<br />具体释义:<br />`contact` 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从 bindcontact 回调中获得具体信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html">具体说明</a> (*鸿蒙 OS 暂不支持*);<br />`liveActivity` 通过前端获取<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html">新的一次性订阅消息下发机制</a>使用的 code;<br />`share` 触发用户转发,使用前建议先阅读<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#使用指引">使用指引</a>;<br />`getPhoneNumber` 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html">具体说明</a> (*小程序插件中不能使用*);<br />`getUserInfo` 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 (*小程序插件中不能使用*);<br />`launchApp` 打开APP,可以通过 app-parameter 属性设定向 APP 传的参数<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html">具体说明</a>;<br />`openSetting` 打开授权设置页;<br />`feedback` 打开“意见反馈”页面,用户可提交反馈内容并上传<a href="https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getLogManager.html">日志</a>,开发者可以登录<a href="https://mp.weixin.qq.com/">小程序管理后台</a>后进入左侧菜单“客服反馈”页面获取到反馈内容;<br />`chooseAvatar` 获取用户头像,可以从 bindchooseavatar 回调中获取到头像信息;<br />`agreePrivacyAuthorization`用户同意隐私协议按钮。用户点击一次此按钮后,所有隐私接口可以正常调用。可通过`bindagreeprivacyauthorization`监听用户同意隐私协议事件。隐私合规开发指南详情可见《<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html">小程序隐私协议开发指南</a>》。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。可选项:contact/share/getPhoneNumber/getUserInfo/launchApp/openSetting/feedback/chooseAvatar/agreePrivacyAuthorization | N
81
84
  phone-number-no-quota-toast | Boolean | true | 原生按钮属性,当手机号快速验证或手机号实时验证额度用尽时,是否对用户展示“申请获取你的手机号,但该功能使用次数已达当前小程序上限,暂时无法使用”的提示,默认展示,open-type="getPhoneNumber" 或 open-type="getRealtimePhoneNumber" 时有效 | N
82
85
  send-message-img | String | 截图 | 会话内消息卡片图片,open-type="contact"时有效 | N
@@ -4,12 +4,15 @@
4
4
  :style="tools._style([customStyle])"
5
5
  :data-custom="customDataset"
6
6
  :class="className"
7
+ :activity-type="activityType ? activityType : ''"
8
+ :entrance-path="entrancePath"
7
9
  :form-type="disabled || loading ? '' : type"
8
10
  :open-type="disabled || loading ? '' : openType"
9
11
  :hover-stop-propagation="hoverStopPropagation"
10
12
  :hover-start-time="hoverStartTime"
11
13
  :hover-stay-time="hoverStayTime"
12
14
  :lang="lang"
15
+ :need-show-entrance="needShowEntrance"
13
16
  :session-from="sessionFrom"
14
17
  :hover-class="disabled || loading ? '' : hoverClass || classPrefix + '--hover'"
15
18
  :send-message-title="sendMessageTitle"
@@ -29,16 +32,16 @@
29
32
  @agreeprivacyauthorization="agreeprivacyauthorization"
30
33
  >
31
34
  <block
32
- v-if="_icon"
35
+ v-if="innerIcon"
33
36
  name="icon"
34
37
  >
35
38
  <t-icon
36
39
  :custom-style="iconCustomStyle"
37
- :t-class="classPrefix + '__icon ' + classPrefix + '__icon--' + (_icon.activeIdx == _icon.index ? 'active ' : ' ') + tClassIcon"
38
- :prefix="_icon.prefix"
39
- :name="_icon.name || ''"
40
- :size="_icon.size"
41
- :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"
42
45
  @click="'handleClose' || ''"
43
46
  />
44
47
  </block>
@@ -62,7 +65,7 @@
62
65
  />
63
66
  <view
64
67
  :class="classPrefix + '__content '
65
- + ((_icon && _icon.name || loading) && content ? classPrefix + '__content--has-icon' : '')"
68
+ + ((innerIcon && innerIcon.name || loading) && content ? classPrefix + '__content--has-icon' : '')"
66
69
  >
67
70
  <slot name="content" />
68
71
  <block v-if="content">
@@ -79,7 +82,7 @@ import TLoading from '../loading/loading';
79
82
  import { uniComponent } from '../common/src/index';
80
83
  import { prefix } from '../common/config';
81
84
  import props from './props';
82
- import { calcIcon } from '../common/utils';
85
+ import { calcIcon, addUnit } from '../common/utils';
83
86
  import tools from '../common/utils.wxs';
84
87
 
85
88
 
@@ -112,7 +115,7 @@ export default uniComponent({
112
115
  prefix,
113
116
  className: '',
114
117
  classPrefix: name,
115
- _icon: undefined,
118
+ innerIcon: undefined,
116
119
  };
117
120
  },
118
121
  computed: {
@@ -126,10 +129,12 @@ export default uniComponent({
126
129
 
127
130
  return tools._style([
128
131
  {
129
- fontSize: fontSize[this.size || 'medium'],
132
+ fontSize: this.innerIcon.size
133
+ ? addUnit(this.innerIcon.size)
134
+ : fontSize[this.size || 'medium'],
130
135
  borderRadius: 'var(--td-button-icon-border-radius, 4px)',
131
136
  },
132
- this._icon.style || '',
137
+ this.innerIcon.style || '',
133
138
  ]);
134
139
  },
135
140
  loadingCustomStyle() {
@@ -143,7 +148,7 @@ export default uniComponent({
143
148
  watch: {
144
149
  icon: {
145
150
  handler(value) {
146
- this._icon = calcIcon(value, '');
151
+ this.innerIcon = calcIcon(value, '');
147
152
  },
148
153
  immediate: true,
149
154
  },
@@ -211,9 +216,8 @@ export default uniComponent({
211
216
  },
212
217
  });
213
218
  </script>
219
+ <style scoped src="./button.css"></style>
214
220
  <style scoped>
215
- @import './button.css';
216
-
217
221
  /* #ifdef MP-QQ */
218
222
  /* 适配 qq 小程序 */
219
223
  .t-button--outline {
@@ -6,6 +6,10 @@
6
6
 
7
7
  import type { TdButtonProps } from './type';
8
8
  export default {
9
+ /** 卡片id。 `open-type` 的值设置为 `liveActivity` ,设置 `activity-type` 参数为 [notify_type](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html)。当用户点击 `button` 后,可以通过 `bindcreateliveactivity` 事件回调获取到 `code` */
10
+ activityType: {
11
+ type: Number,
12
+ },
9
13
  /** 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 */
10
14
  appParameter: {
11
15
  type: String,
@@ -27,6 +31,11 @@ export default {
27
31
  type: Boolean,
28
32
  default: undefined,
29
33
  },
34
+ /** 从消息小程序入口打开小程序的路径,默认为聊天工具启动路径 */
35
+ entrancePath: {
36
+ type: String,
37
+ default: '',
38
+ },
30
39
  /** 是否为幽灵按钮(镂空按钮) */
31
40
  ghost: Boolean,
32
41
  /** 指定按钮按下去的样式类,按钮不为加载或禁用状态时有效。当 `hover-class="none"` 时,没有点击态效果 */
@@ -65,6 +74,11 @@ export default {
65
74
  type: Object,
66
75
  default: () => ({}),
67
76
  },
77
+ /** 转发的文本消息是否要带小程序入口 */
78
+ needShowEntrance: {
79
+ type: Boolean,
80
+ default: true,
81
+ },
68
82
  /** 微信开放能力。<br />具体释义:<br />`contact` 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从 bindcontact 回调中获得具体信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html">具体说明</a> (*鸿蒙 OS 暂不支持*);<br />`liveActivity` 通过前端获取<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html">新的一次性订阅消息下发机制</a>使用的 code;<br />`share` 触发用户转发,使用前建议先阅读<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#使用指引">使用指引</a>;<br />`getPhoneNumber` 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html">具体说明</a> (*小程序插件中不能使用*);<br />`getUserInfo` 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 (*小程序插件中不能使用*);<br />`launchApp` 打开APP,可以通过 app-parameter 属性设定向 APP 传的参数<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html">具体说明</a>;<br />`openSetting` 打开授权设置页;<br />`feedback` 打开“意见反馈”页面,用户可提交反馈内容并上传<a href="https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getLogManager.html">日志</a>,开发者可以登录<a href="https://mp.weixin.qq.com/">小程序管理后台</a>后进入左侧菜单“客服反馈”页面获取到反馈内容;<br />`chooseAvatar` 获取用户头像,可以从 bindchooseavatar 回调中获取到头像信息;<br />`agreePrivacyAuthorization`用户同意隐私协议按钮。用户点击一次此按钮后,所有隐私接口可以正常调用。可通过`bindagreeprivacyauthorization`监听用户同意隐私协议事件。隐私合规开发指南详情可见《<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html">小程序隐私协议开发指南</a>》。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) */
69
83
  openType: {
70
84
  type: String,
@@ -7,6 +7,10 @@
7
7
  import type { TdLoadingProps as LoadingProps } from '../loading/type';
8
8
 
9
9
  export interface TdButtonProps {
10
+ /**
11
+ * 卡片id。 `open-type` 的值设置为 `liveActivity` ,设置 `activity-type` 参数为 [notify_type](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html)。当用户点击 `button` 后,可以通过 `bindcreateliveactivity` 事件回调获取到 `code`
12
+ */
13
+ activityType?: number;
10
14
  /**
11
15
  * 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
12
16
  * @default ''
@@ -30,6 +34,11 @@ export interface TdButtonProps {
30
34
  * 禁用状态。优先级:Button.disabled > Form.disabled
31
35
  */
32
36
  disabled?: boolean;
37
+ /**
38
+ * 从消息小程序入口打开小程序的路径,默认为聊天工具启动路径
39
+ * @default ''
40
+ */
41
+ entrancePath?: string;
33
42
  /**
34
43
  * 是否为幽灵按钮(镂空按钮)
35
44
  * @default false
@@ -73,6 +82,11 @@ export interface TdButtonProps {
73
82
  * @default {}
74
83
  */
75
84
  loadingProps?: LoadingProps;
85
+ /**
86
+ * 转发的文本消息是否要带小程序入口
87
+ * @default true
88
+ */
89
+ needShowEntrance?: boolean;
76
90
  /**
77
91
  * 微信开放能力。<br />具体释义:<br />`contact` 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从 bindcontact 回调中获得具体信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html">具体说明</a> (*鸿蒙 OS 暂不支持*);<br />`liveActivity` 通过前端获取<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html">新的一次性订阅消息下发机制</a>使用的 code;<br />`share` 触发用户转发,使用前建议先阅读<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#使用指引">使用指引</a>;<br />`getPhoneNumber` 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html">具体说明</a> (*小程序插件中不能使用*);<br />`getUserInfo` 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 (*小程序插件中不能使用*);<br />`launchApp` 打开APP,可以通过 app-parameter 属性设定向 APP 传的参数<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html">具体说明</a>;<br />`openSetting` 打开授权设置页;<br />`feedback` 打开“意见反馈”页面,用户可提交反馈内容并上传<a href="https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getLogManager.html">日志</a>,开发者可以登录<a href="https://mp.weixin.qq.com/">小程序管理后台</a>后进入左侧菜单“客服反馈”页面获取到反馈内容;<br />`chooseAvatar` 获取用户头像,可以从 bindchooseavatar 回调中获取到头像信息;<br />`agreePrivacyAuthorization`用户同意隐私协议按钮。用户点击一次此按钮后,所有隐私接口可以正常调用。可通过`bindagreeprivacyauthorization`监听用户同意隐私协议事件。隐私合规开发指南详情可见《<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html">小程序隐私协议开发指南</a>》。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)
78
92
  */
@@ -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>