@opentiny/vue-docs 3.28.1 → 3.30.0

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 (285) hide show
  1. package/demos/apis/action-menu.js +22 -0
  2. package/demos/apis/alert.js +19 -22
  3. package/demos/apis/button-group.js +15 -0
  4. package/demos/apis/calendar-view.js +5 -5
  5. package/demos/apis/cascader-view.js +5 -5
  6. package/demos/apis/dialog-box.js +39 -38
  7. package/demos/apis/drawer.js +31 -0
  8. package/demos/apis/dropdown.js +39 -1
  9. package/demos/apis/filter-panel.js +21 -1
  10. package/demos/apis/fluent-editor.js +30 -0
  11. package/demos/apis/form.js +11 -0
  12. package/demos/apis/fullscreen.js +10 -11
  13. package/demos/apis/grid.js +131 -16
  14. package/demos/apis/guide.js +14 -0
  15. package/demos/apis/link.js +11 -0
  16. package/demos/apis/message.js +48 -22
  17. package/demos/apis/modal.js +34 -31
  18. package/demos/apis/notify.js +13 -13
  19. package/demos/apis/rate.js +15 -0
  20. package/demos/apis/search-box.js +343 -0
  21. package/demos/apis/select.js +14 -2
  22. package/demos/apis/tag-input.js +182 -0
  23. package/demos/apis/tree.js +23 -23
  24. package/demos/mobile-first/app/button-group/display-mode.vue +31 -0
  25. package/demos/mobile-first/app/button-group/webdoc/button-group.js +13 -0
  26. package/demos/mobile-first/app/calendar-view/webdoc/calendar-view.js +5 -4
  27. package/demos/mobile-first/app/modal/webdoc/modal.js +2 -1
  28. package/demos/pc/app/alert/center.spec.ts +8 -0
  29. package/demos/pc/app/alert/custom-close.spec.ts +39 -9
  30. package/demos/pc/app/alert/icon.spec.ts +18 -7
  31. package/demos/pc/app/alert/show-icon.spec.ts +1 -1
  32. package/demos/pc/app/anchor/webdoc/anchor.js +1 -0
  33. package/demos/pc/app/base-select/copy-multi.spec.ts +1 -1
  34. package/demos/pc/app/button-group/display-mode-composition-api.vue +23 -0
  35. package/demos/pc/app/button-group/display-mode.spec.ts +0 -0
  36. package/demos/pc/app/button-group/display-mode.vue +31 -0
  37. package/demos/pc/app/button-group/sup-composition-api.vue +1 -0
  38. package/demos/pc/app/button-group/sup.vue +1 -0
  39. package/demos/pc/app/button-group/webdoc/button-group.js +14 -0
  40. package/demos/pc/app/calendar-view/calendar-event.spec.ts +1 -1
  41. package/demos/pc/app/calendar-view/custom-day-bg-color.vue +10 -0
  42. package/demos/pc/app/calendar-view/webdoc/calendar-view.js +4 -4
  43. package/demos/pc/app/cascader/filter-mode-composition-api.vue +2 -3
  44. package/demos/pc/app/checkbox/checked-composition-api.vue +3 -3
  45. package/demos/pc/app/checkbox/checked.vue +3 -3
  46. package/demos/pc/app/date-picker/align.spec.ts +10 -13
  47. package/demos/pc/app/date-picker/clear.spec.ts +3 -3
  48. package/demos/pc/app/date-picker/default-value.spec.ts +4 -4
  49. package/demos/pc/app/date-picker/events.spec.ts +2 -2
  50. package/demos/pc/app/date-picker/format.spec.ts +3 -3
  51. package/demos/pc/app/date-picker/now.spec.ts +4 -4
  52. package/demos/pc/app/date-picker/shortcuts.spec.ts +1 -1
  53. package/demos/pc/app/date-picker/slot.spec.ts +5 -5
  54. package/demos/pc/app/dialog-box/basic-usage.spec.ts +5 -5
  55. package/demos/pc/app/dialog-box/form-in-dialog.spec.ts +1 -2
  56. package/demos/pc/app/drawer/basic-usage.spec.ts +4 -3
  57. package/demos/pc/app/drawer/close-on-press-escape.spec.ts +4 -2
  58. package/demos/pc/app/drawer/placement.spec.ts +4 -4
  59. package/demos/pc/app/drawer/show-header.spec.ts +3 -2
  60. package/demos/pc/app/drawer/webdoc/drawer.js +3 -2
  61. package/demos/pc/app/dropdown/show-icon-composition-api.vue +1 -1
  62. package/demos/pc/app/dropdown/show-icon.vue +1 -1
  63. package/demos/pc/app/dropdown/tip-composition-api.vue +5 -2
  64. package/demos/pc/app/dropdown/tip.vue +5 -2
  65. package/demos/pc/app/dropdown/webdoc/dropdown.js +2 -2
  66. package/demos/pc/app/filter-panel/size-composition-api.vue +58 -0
  67. package/demos/pc/app/filter-panel/size.spec.ts +23 -0
  68. package/demos/pc/app/filter-panel/size.vue +68 -0
  69. package/demos/pc/app/filter-panel/webdoc/filter-panel.js +13 -0
  70. package/demos/pc/app/flowchart/basic-usage-composition-api.vue +10 -260
  71. package/demos/pc/app/flowchart/basic-usage.spec.ts +2 -1
  72. package/demos/pc/app/flowchart/basic-usage.vue +4 -249
  73. package/demos/pc/app/flowchart/slots-composition-api.vue +182 -0
  74. package/demos/pc/app/flowchart/slots.spec.ts +24 -0
  75. package/demos/pc/app/flowchart/slots.vue +193 -0
  76. package/demos/pc/app/flowchart/webdoc/flowchart.js +14 -2
  77. package/demos/pc/app/form/basic-usage.spec.ts +6 -4
  78. package/demos/pc/app/form/custom-validation-string-length-composition-api.vue +38 -0
  79. package/demos/pc/app/form/custom-validation-string-length.spec.ts +18 -0
  80. package/demos/pc/app/form/custom-validation-string-length.vue +28 -13
  81. package/demos/pc/app/form/group-form-composition-api.vue +2 -2
  82. package/demos/pc/app/form/group-form.vue +2 -2
  83. package/demos/pc/app/grid/filter/advanced-filter-composition-api.vue +1 -1
  84. package/demos/pc/app/grid/filter/advanced-filter.spec.js +1 -0
  85. package/demos/pc/app/grid/filter/advanced-filter.vue +1 -1
  86. package/demos/pc/app/grid/filter/custom-filter-composition-api.vue +46 -23
  87. package/demos/pc/app/grid/filter/custom-filter.spec.js +1 -1
  88. package/demos/pc/app/grid/filter/custom-filter.vue +47 -24
  89. package/demos/pc/app/grid/filter/default-filter-composition-api.vue +5 -1
  90. package/demos/pc/app/grid/filter/default-filter.spec.ts +1 -0
  91. package/demos/pc/app/grid/filter/default-filter.vue +4 -1
  92. package/demos/pc/app/grid/filter/filter-label-value-composition-api.vue +71 -0
  93. package/demos/pc/app/grid/filter/filter-label-value.spec.ts +27 -0
  94. package/demos/pc/app/grid/filter/filter-label-value.vue +78 -0
  95. package/demos/pc/app/grid/filter/input-filter-custom-component-composition-api.vue +116 -0
  96. package/demos/pc/app/grid/filter/input-filter-custom-component.spec.ts +20 -0
  97. package/demos/pc/app/grid/filter/input-filter-custom-component.vue +126 -0
  98. package/demos/pc/app/grid/filter/layout-order-filter-composition-api.vue +114 -0
  99. package/demos/pc/app/grid/filter/layout-order-filter.spec.ts +31 -0
  100. package/demos/pc/app/grid/filter/layout-order-filter.vue +123 -0
  101. package/demos/pc/app/grid/toolbar/custom-toolbar.spec.js +1 -1
  102. package/demos/pc/app/grid/webdoc/grid-filter.js +89 -40
  103. package/demos/pc/app/guide/show-close-composition-api.vue +77 -0
  104. package/demos/pc/app/guide/show-close.spec.ts +37 -0
  105. package/demos/pc/app/guide/show-close.vue +84 -0
  106. package/demos/pc/app/guide/webdoc/guide.js +12 -0
  107. package/demos/pc/app/icon/advance-icons.js +108 -2
  108. package/demos/pc/app/icon/advance-usage-composition-api.vue +26 -1
  109. package/demos/pc/app/icon/advance-usage.vue +27 -1
  110. package/demos/pc/app/icon/webdoc/icon.js +5 -3
  111. package/demos/pc/app/input/resize.spec.ts +2 -2
  112. package/demos/pc/app/link/custom-icon-composition-api.vue +1 -1
  113. package/demos/pc/app/link/custom-icon.vue +1 -1
  114. package/demos/pc/app/link/target-composition-api.vue +24 -0
  115. package/demos/pc/app/link/target.spec.ts +41 -0
  116. package/demos/pc/app/link/target.vue +30 -0
  117. package/demos/pc/app/link/webdoc/link.js +14 -0
  118. package/demos/pc/app/message/basic-usage-composition-api.vue +48 -0
  119. package/demos/pc/app/message/basic-usage.spec.ts +27 -0
  120. package/demos/pc/app/message/basic-usage.vue +50 -0
  121. package/demos/pc/app/message/message-close-composition-api.vue +25 -0
  122. package/demos/pc/app/message/message-close.spec.ts +9 -0
  123. package/demos/pc/app/message/message-close.vue +32 -0
  124. package/demos/pc/app/message/message-duration-composition-api.vue +25 -0
  125. package/demos/pc/app/message/message-duration.spec.ts +9 -0
  126. package/demos/pc/app/message/message-duration.vue +32 -0
  127. package/demos/pc/app/message/prevent-duplicate-composition-api.vue +25 -0
  128. package/demos/pc/app/message/prevent-duplicate.spec.ts +9 -0
  129. package/demos/pc/app/message/prevent-duplicate.vue +32 -0
  130. package/demos/pc/app/message/webdoc/message.cn.md +7 -0
  131. package/demos/pc/app/message/webdoc/message.en.md +7 -0
  132. package/demos/pc/app/message/webdoc/message.js +56 -0
  133. package/demos/pc/app/modal/basic-usage.spec.ts +3 -3
  134. package/demos/pc/app/modal/modal-footer-composition-api.vue +3 -3
  135. package/demos/pc/app/modal/modal-footer.spec.ts +9 -4
  136. package/demos/pc/app/modal/modal-footer.vue +3 -3
  137. package/demos/pc/app/modal/modal-header.spec.ts +2 -2
  138. package/demos/pc/app/modal/modal-size.spec.ts +2 -2
  139. package/demos/pc/app/modal/status.spec.ts +22 -15
  140. package/demos/pc/app/nav-menu/overflow.spec.ts +1 -1
  141. package/demos/pc/app/popconfirm/custom-class.spec.ts +0 -1
  142. package/demos/pc/app/popconfirm/slot-message.spec.ts +10 -2
  143. package/demos/pc/app/popconfirm/trigger.spec.ts +16 -12
  144. package/demos/pc/app/popover/basic-usage.spec.js +3 -8
  145. package/demos/pc/app/popover/custom-popper.spec.js +2 -2
  146. package/demos/pc/app/popover/delay.spec.js +2 -2
  147. package/demos/pc/app/popover/disabled.spec.js +2 -2
  148. package/demos/pc/app/popover/events.spec.js +1 -1
  149. package/demos/pc/app/popover/ignore-boundaries.spec.js +2 -3
  150. package/demos/pc/app/popover/offset.spec.js +17 -31
  151. package/demos/pc/app/radio/dynamic-disable-composition-api.vue +3 -3
  152. package/demos/pc/app/radio/dynamic-disable.vue +2 -2
  153. package/demos/pc/app/rate/clearable-composition-api.vue +20 -0
  154. package/demos/pc/app/rate/clearable.spec.js +74 -0
  155. package/demos/pc/app/rate/clearable.vue +28 -0
  156. package/demos/pc/app/rate/webdoc/rate.js +12 -0
  157. package/demos/pc/app/search/events.spec.ts +1 -1
  158. package/demos/pc/app/search-box/append-to-body-composition-api.vue +300 -0
  159. package/demos/pc/app/search-box/append-to-body.vue +308 -0
  160. package/demos/pc/app/search-box/auto-match-composition-api.vue +162 -0
  161. package/demos/pc/app/search-box/auto-match.vue +170 -0
  162. package/demos/pc/app/search-box/basic-usage-composition-api.vue +269 -0
  163. package/demos/pc/app/search-box/basic-usage.vue +277 -0
  164. package/demos/pc/app/search-box/custom-panel-composition-api.vue +63 -0
  165. package/demos/pc/app/search-box/custom-panel.vue +72 -0
  166. package/demos/pc/app/search-box/default-field-composition-api.vue +163 -0
  167. package/demos/pc/app/search-box/default-field.vue +171 -0
  168. package/demos/pc/app/search-box/editable-composition-api.vue +311 -0
  169. package/demos/pc/app/search-box/editable.vue +320 -0
  170. package/demos/pc/app/search-box/empty-placeholder-composition-api.vue +162 -0
  171. package/demos/pc/app/search-box/empty-placeholder.vue +170 -0
  172. package/demos/pc/app/search-box/events-composition-api.vue +169 -0
  173. package/demos/pc/app/search-box/events.vue +173 -0
  174. package/demos/pc/app/search-box/group-key-composition-api.vue +257 -0
  175. package/demos/pc/app/search-box/group-key.vue +266 -0
  176. package/demos/pc/app/search-box/help-composition-api.vue +166 -0
  177. package/demos/pc/app/search-box/help.vue +175 -0
  178. package/demos/pc/app/search-box/id-map-key-composition-api.vue +131 -0
  179. package/demos/pc/app/search-box/id-map-key.vue +140 -0
  180. package/demos/pc/app/search-box/item-placeholder-composition-api.vue +119 -0
  181. package/demos/pc/app/search-box/item-placeholder.vue +127 -0
  182. package/demos/pc/app/search-box/max-length-composition-api.vue +29 -0
  183. package/demos/pc/app/search-box/max-length.vue +38 -0
  184. package/demos/pc/app/search-box/max-time-length-composition-api.vue +53 -0
  185. package/demos/pc/app/search-box/max-time-length.vue +62 -0
  186. package/demos/pc/app/search-box/merge-tag-composition-api.vue +59 -0
  187. package/demos/pc/app/search-box/merge-tag.vue +68 -0
  188. package/demos/pc/app/search-box/panel-max-height-composition-api.vue +162 -0
  189. package/demos/pc/app/search-box/panel-max-height.vue +170 -0
  190. package/demos/pc/app/search-box/potential-match-composition-api.vue +193 -0
  191. package/demos/pc/app/search-box/potential-match.vue +201 -0
  192. package/demos/pc/app/search-box/settings-composition-api.vue +163 -0
  193. package/demos/pc/app/search-box/settings.vue +171 -0
  194. package/demos/pc/app/search-box/size-composition-api.vue +162 -0
  195. package/demos/pc/app/search-box/size.vue +170 -0
  196. package/demos/pc/app/search-box/split-input-value-composition-api.vue +162 -0
  197. package/demos/pc/app/search-box/split-input-value.vue +170 -0
  198. package/demos/pc/app/search-box/suffix-icon-composition-api.vue +209 -0
  199. package/demos/pc/app/search-box/suffix-icon.vue +219 -0
  200. package/demos/pc/app/search-box/v-model-composition-api.vue +174 -0
  201. package/demos/pc/app/search-box/v-model.vue +182 -0
  202. package/demos/pc/app/search-box/webdoc/search-box.cn.md +7 -0
  203. package/demos/pc/app/search-box/webdoc/search-box.en.md +7 -0
  204. package/demos/pc/app/search-box/webdoc/search-box.js +257 -0
  205. package/demos/pc/app/select/copy-multi.spec.ts +1 -1
  206. package/demos/pc/app/select-wrapper/copy-multi.spec.ts +2 -1
  207. package/demos/pc/app/tabs/basic-usage.spec.ts +2 -2
  208. package/demos/pc/app/tabs/more-show-all.spec.ts +2 -1
  209. package/demos/pc/app/tabs/tabs-events-close-composition-api.vue +8 -2
  210. package/demos/pc/app/tabs/tabs-events-close.vue +8 -2
  211. package/demos/pc/app/tag/basic-usage.spec.ts +1 -1
  212. package/demos/pc/app/tag/color-border.spec.ts +2 -2
  213. package/demos/pc/app/tag/max-width.spec.ts +1 -1
  214. package/demos/pc/app/tag/size.spec.ts +3 -3
  215. package/demos/pc/app/tag/slot-default.spec.ts +3 -3
  216. package/demos/pc/app/tag-group/basic-usage.spec.js +5 -5
  217. package/demos/pc/app/tag-group/tag-group-effect.spec.js +10 -10
  218. package/demos/pc/app/tag-group/tag-group-event.spec.js +1 -1
  219. package/demos/pc/app/tag-input/basic-usage-composition-api.vue +29 -0
  220. package/demos/pc/app/tag-input/basic-usage.spec.ts +0 -0
  221. package/demos/pc/app/tag-input/basic-usage.vue +38 -0
  222. package/demos/pc/app/tag-input/clearable-tag-composition-api.vue +20 -0
  223. package/demos/pc/app/tag-input/clearable-tag.vue +27 -0
  224. package/demos/pc/app/tag-input/collapsed-tag-composition-api.vue +20 -0
  225. package/demos/pc/app/tag-input/collapsed-tag.vue +28 -0
  226. package/demos/pc/app/tag-input/disabled-readonly-composition-api.vue +20 -0
  227. package/demos/pc/app/tag-input/disabled-readonly.vue +29 -0
  228. package/demos/pc/app/tag-input/draggable-tag-composition-api.vue +12 -0
  229. package/demos/pc/app/tag-input/draggable-tag.spec.ts +0 -0
  230. package/demos/pc/app/tag-input/draggable-tag.vue +20 -0
  231. package/demos/pc/app/tag-input/max-composition-api.vue +20 -0
  232. package/demos/pc/app/tag-input/max.vue +28 -0
  233. package/demos/pc/app/tag-input/prefix-suffix-composition-api.vue +26 -0
  234. package/demos/pc/app/tag-input/prefix-suffix.vue +34 -0
  235. package/demos/pc/app/tag-input/separator-tag-composition-api.vue +20 -0
  236. package/demos/pc/app/tag-input/separator-tag.vue +28 -0
  237. package/demos/pc/app/tag-input/webdoc/tag-input.cn.md +7 -0
  238. package/demos/pc/app/tag-input/webdoc/tag-input.en.md +7 -0
  239. package/demos/pc/app/tag-input/webdoc/tag-input.js +107 -0
  240. package/demos/pc/app/time-picker/basic-usage.spec.ts +5 -4
  241. package/demos/pc/app/time-picker/clearable.spec.ts +5 -4
  242. package/demos/pc/app/time-picker/default-value.spec.ts +2 -2
  243. package/demos/pc/app/time-picker/disabled.spec.ts +4 -3
  244. package/demos/pc/app/time-picker/format.spec.ts +8 -11
  245. package/demos/pc/app/time-picker/is-range.spec.ts +4 -3
  246. package/demos/pc/app/time-picker/name.spec.ts +1 -1
  247. package/demos/pc/app/time-picker/placeholder.spec.ts +3 -3
  248. package/demos/pc/app/time-picker/popper-class.spec.ts +1 -1
  249. package/demos/pc/app/time-picker/size.spec.ts +2 -1
  250. package/demos/pc/app/time-select/basic-usage.spec.ts +1 -1
  251. package/demos/pc/app/time-select/clear-icon.spec.ts +1 -2
  252. package/demos/pc/app/time-select/focus.spec.ts +1 -1
  253. package/demos/pc/app/time-select/picker-options.spec.ts +2 -1
  254. package/demos/pc/app/time-select/range-placeholder.spec.ts +2 -2
  255. package/demos/pc/app/time-select/size-medium.spec.ts +3 -3
  256. package/demos/pc/app/tooltip/delay.spec.js +7 -9
  257. package/demos/pc/app/tooltip/offset.spec.js +0 -2
  258. package/demos/pc/app/tooltip/popper-options.spec.js +2 -1
  259. package/demos/pc/menus.js +6 -4
  260. package/demos/pc/webdoc/changelog-en.md +209 -86
  261. package/demos/pc/webdoc/changelog.md +176 -257
  262. package/demos/pc/webdoc/develop-demo-en.md +13 -13
  263. package/demos/pc/webdoc/import-components.md +1 -1
  264. package/demos/pc/webdoc/introduce.md +2 -0
  265. package/demos/pc/webdoc/skills-en.md +107 -0
  266. package/demos/pc/webdoc/skills.md +107 -0
  267. package/demos/pc/webdoc/theme-en.md +82 -79
  268. package/demos/pc/webdoc/v3.28.0-release-article.md +943 -0
  269. package/demos/saas/menus.js +1 -0
  270. package/package.json +21 -20
  271. package/playground/App.vue +6 -4
  272. package/playground/shims/vue-search-box.mjs +154 -0
  273. package/public/static/css/mobile-dark-theme.css +1 -0
  274. package/src/i18n/index.js +1 -2
  275. package/src/main.js +8 -5
  276. package/src/style.css +5 -0
  277. package/src/views/components-doc/common.vue +0 -25
  278. package/src/views/components-doc/mobile.vue +49 -2
  279. package/vite.config.ts +3 -2
  280. package/vite.extend.ts +65 -0
  281. package/demos/pc/app/grid/webdoc/grid-ai-agent.js +0 -23
  282. package/demos/pc/webdoc/mcp-en.md +0 -101
  283. package/demos/pc/webdoc/mcp.md +0 -101
  284. package/src/components/mcp-docs.vue +0 -33
  285. package/src/composable/useTinyRemoter.ts +0 -176
@@ -0,0 +1,257 @@
1
+ export default {
2
+ column: '2',
3
+ owner: '',
4
+ demos: [
5
+ {
6
+ demoId: 'basic-usage',
7
+ name: {
8
+ 'zh-CN': '基础用法',
9
+ 'en-US': 'Basic Usage'
10
+ },
11
+ desc: {
12
+ 'zh-CN': ' 通过 items 配置搜索数据项。 ',
13
+ 'en-US': ' Configure search data items through items . '
14
+ },
15
+ codeFiles: ['basic-usage.vue']
16
+ },
17
+ {
18
+ demoId: 'append-to-body',
19
+ name: {
20
+ 'zh-CN': '挂载到 body',
21
+ 'en-US': 'Append to Body'
22
+ },
23
+ desc: {
24
+ 'zh-CN': ' 通过 append-to-body 配置将下拉面板挂载到 body。 ',
25
+ 'en-US': ' Use append-to-body to configure the drop-down panel to be mounted to the body. '
26
+ },
27
+ codeFiles: ['append-to-body.vue']
28
+ },
29
+ {
30
+ demoId: 'panel-max-height',
31
+ name: {
32
+ 'zh-CN': '面板最大高度',
33
+ 'en-US': 'Maximum panel height'
34
+ },
35
+ desc: {
36
+ 'zh-CN': ' 通过 panel-max-height 配置下拉面板最大高度。 ',
37
+ 'en-US': ' Set panel-max-height to configure the maximum height of the drop-down list box. '
38
+ },
39
+ codeFiles: ['panel-max-height.vue']
40
+ },
41
+ {
42
+ demoId: 'split-input-value',
43
+ name: {
44
+ 'zh-CN': '切分输入值',
45
+ 'en-US': 'Segmentation Input Value'
46
+ },
47
+ desc: {
48
+ 'zh-CN': ` 通过 split-input-value='|' 将输入值按字符 | 分成多个关键字,一次性输入生成多个标签,默认 , 分隔。 `,
49
+ 'en-US': ` Use split-input-value='|' to split the input value into multiple keywords by | . Multiple tags are generated for one input. By default, , is used to separate multiple keywords. `
50
+ },
51
+ codeFiles: ['split-input-value.vue']
52
+ },
53
+ {
54
+ demoId: 'default-field',
55
+ name: {
56
+ 'zh-CN': '自定义默认搜索项',
57
+ 'en-US': 'Customizing Default Search Terms'
58
+ },
59
+ desc: {
60
+ 'zh-CN': ' 通过 default-field 配置按照可用地区进行搜索。 ',
61
+ 'en-US': ' Set default-field to search by available region. '
62
+ },
63
+ codeFiles: ['default-field.vue']
64
+ },
65
+ {
66
+ demoId: 'v-model',
67
+ name: {
68
+ 'zh-CN': '默认包含筛选项',
69
+ 'en-US': 'Filter Items Are Included By Default'
70
+ },
71
+ desc: {
72
+ 'zh-CN': ' 通过 model-value 配置默认选中标签项。 ',
73
+ 'en-US': ' Use model-value to configure the default selected label item. '
74
+ },
75
+ codeFiles: ['v-model.vue']
76
+ },
77
+ {
78
+ demoId: 'empty-placeholder',
79
+ name: {
80
+ 'zh-CN': '没有筛选项时的占位文本',
81
+ 'en-US': 'Placeholder Text When There Are No Filters.'
82
+ },
83
+ desc: {
84
+ 'zh-CN': ' 通过 empty-placeholder 配置筛选项为空时占位文本。 ',
85
+ 'en-US': ' Use empty-placeholder to configure the placeholder text when the filter item is empty. '
86
+ },
87
+ codeFiles: ['empty-placeholder.vue']
88
+ },
89
+ {
90
+ demoId: 'id-map-key',
91
+ name: {
92
+ 'zh-CN': '指定筛选项的ID键取值',
93
+ 'en-US': 'Specifies the ID key value of a filtering item'
94
+ },
95
+ desc: {
96
+ 'zh-CN': ` 通过 id-map-key 配置用来识别筛选项的 id 键取值来源,默认取自 items 的 id 键,
97
+ 一般用于接口返回的 items 数据字段不匹配,但是又需要其中一个键值来识别筛选项的情况。 `,
98
+ 'en-US': ` Use id-map-key to configure the value source of the id key used to identify screening items. The default value is the id key of items .
99
+ Generally, the items data field returned by the interface does not match, but a key value is required to identify the filtering item. `
100
+ },
101
+ codeFiles: ['id-map-key.vue']
102
+ },
103
+ {
104
+ demoId: 'potential-options',
105
+ name: {
106
+ 'zh-CN': '潜在匹配项',
107
+ 'en-US': 'Potential Match'
108
+ },
109
+ desc: {
110
+ 'zh-CN': ' 通过 potential-options 配置潜在匹配项。 ',
111
+ 'en-US': ' Use potential-options to configure potential matches. '
112
+ },
113
+ codeFiles: ['potential-match.vue']
114
+ },
115
+ {
116
+ demoId: 'group-key',
117
+ name: {
118
+ 'zh-CN': '自定义属性分组',
119
+ 'en-US': 'User-defined attribute group'
120
+ },
121
+ desc: {
122
+ 'zh-CN': ' 通过 item.groupKey 自定义一级下拉框属性分组。 ',
123
+ 'en-US': ' '
124
+ },
125
+ codeFiles: ['group-key.vue', 'group-key-data.ts']
126
+ },
127
+ {
128
+ demoId: 'help',
129
+ name: {
130
+ 'zh-CN': 'help 提示场景',
131
+ 'en-US': 'Help Prompt Scenario'
132
+ },
133
+ desc: {
134
+ 'zh-CN': ' 通过 show-help 控制帮助图标显隐,使用 help 事件回调自定义弹窗提示内容。 ',
135
+ 'en-US':
136
+ ' Use show-help to show or hide the help icon, and use the help event callback to customize the pop-up window content. '
137
+ },
138
+ codeFiles: ['help.vue']
139
+ },
140
+ {
141
+ demoId: 'editable',
142
+ name: {
143
+ 'zh-CN': '可编辑',
144
+ 'en-US': 'Editable'
145
+ },
146
+ desc: {
147
+ 'zh-CN': ' 标签支持可编辑功能,通过 editable 打开编辑功能,(注:map 类型不支持编辑)。 ',
148
+ 'en-US': ' Tags can be edited. To edit a tag, enter editable . Tags of the map type cannot be edited. '
149
+ },
150
+ codeFiles: ['editable.vue', 'editable-data.ts']
151
+ },
152
+ {
153
+ demoId: 'item-placeholder',
154
+ name: {
155
+ 'zh-CN': '数据项占位文本',
156
+ 'en-US': 'Data Item Placeholder Text'
157
+ },
158
+ desc: {
159
+ 'zh-CN': ' 通过 item.placeholder 设置占位文本, item.editAttrDisabled 设置编辑状态下此属性类型不可切换。 ',
160
+ 'en-US':
161
+ ' Set the placeholder text through item.placeholder , item.editAttrDisabled This attribute type cannot be switched in the editing state. '
162
+ },
163
+ codeFiles: ['item-placeholder.vue']
164
+ },
165
+ {
166
+ demoId: 'auto-match',
167
+ name: {
168
+ 'zh-CN': '自动匹配',
169
+ 'en-US': 'Automatic Matching'
170
+ },
171
+ desc: {
172
+ 'zh-CN':
173
+ ' 内置自动匹配功能,通过 :show-no-data-tip="false" 隐藏面板的无数据提示,通过 search 监听搜索事件, change 监听搜索值变化事件。 ',
174
+ 'en-US':
175
+ ' Built-in auto-matching function. No Data Prompt for Hiding Panels via :show-no-data-tip="false" . Use search to listen to search events and change to listen to search value change events. '
176
+ },
177
+ codeFiles: ['auto-match.vue']
178
+ },
179
+ {
180
+ demoId: 'merge-tag',
181
+ name: {
182
+ 'zh-CN': '合并多选标签',
183
+ 'en-US': 'Merge Multiple Selection Labels'
184
+ },
185
+ desc: {
186
+ 'zh-CN': ' 通过 mergeTag 合并多选标签,(注:仅多选标签支持合并功能)。 ',
187
+ 'en-US': ' Use mergeTag to merge multiple tags. (Note: Only multiple tags can be merged.) '
188
+ },
189
+ codeFiles: ['merge-tag.vue']
190
+ },
191
+ {
192
+ demoId: 'max-length',
193
+ name: {
194
+ 'zh-CN': '输入长度限制',
195
+ 'en-US': 'Input Length Limit'
196
+ },
197
+ desc: {
198
+ 'zh-CN': ' 通过 maxlength 原生属性限制输入不超过8个字符长度,配合 exceed 监听输入超出限定长度的事件。 ',
199
+ 'en-US':
200
+ ' The maxlength native attribute is used to restrict the input to a maximum of eight characters. This attribute is used together with exceed to listen to the event that the input exceeds the specified length. '
201
+ },
202
+ codeFiles: ['max-length.vue']
203
+ },
204
+ {
205
+ demoId: 'max-time-length',
206
+ name: {
207
+ 'zh-CN': '时间长度限制',
208
+ 'en-US': 'Time Length Limit'
209
+ },
210
+ desc: {
211
+ 'zh-CN':
212
+ ' 通过 maxTimeLength 传入某段时间的值(毫秒数),来限制可选择的时间跨度,常用于防止请求时间跨度过大的情形。 ',
213
+ 'en-US':
214
+ ' Use maxTimeLength to pass in the value (in milliseconds) of a time period to limit the time span that can be selected. This is often used to prevent the request time span from being too large. '
215
+ },
216
+ codeFiles: ['max-time-length.vue']
217
+ },
218
+ {
219
+ demoId: 'custom-panel',
220
+ name: {
221
+ 'zh-CN': '自定义二级下拉面板',
222
+ 'en-US': 'Customizing the Level-2 Drop-down Panel'
223
+ },
224
+ desc: {
225
+ 'zh-CN':
226
+ " 通过 item.type = 'custom' 开启自定义二级下拉面板功能,并在 item.slotName 自定义对应的二级面板插槽名,对应的编辑态自定义面板插槽名为 `${item.slotName}-edit` 。 ",
227
+ 'en-US':
228
+ " Use item.type = 'custom' to enable the function of customizing the level-2 drop-down panel and customize the slot name of the level-2 panel in item.slotName . The slot name of the corresponding customized panel in editing state is `${item.slotName}-edit` . "
229
+ },
230
+ codeFiles: ['custom-panel.vue']
231
+ },
232
+ {
233
+ demoId: 'events',
234
+ name: {
235
+ 'zh-CN': '事件',
236
+ 'en-US': 'Events'
237
+ },
238
+ desc: {
239
+ 'zh-CN': ' 通过 first-level-select 监听第一层级选择事件。 ',
240
+ 'en-US': ' Listen to the first-level selection event through first-level-select . '
241
+ },
242
+ codeFiles: ['events.vue']
243
+ },
244
+ {
245
+ demoId: 'suffix-icon',
246
+ name: {
247
+ 'zh-CN': '后缀图标',
248
+ 'en-US': 'Suffix Icon'
249
+ },
250
+ desc: {
251
+ 'zh-CN': ' 通过 suffix-icon 配置后缀图标。 ',
252
+ 'en-US': ' Use suffix-icon to configure the suffix icon. '
253
+ },
254
+ codeFiles: ['suffix-icon.vue']
255
+ }
256
+ ]
257
+ }
@@ -10,7 +10,7 @@ test('多选复制单个标签', async ({ page }) => {
10
10
 
11
11
  await expect(tag).toContainText('北京')
12
12
  await page.waitForTimeout(200)
13
- const tagBox = await tag.locator('span').boundingBox()
13
+ const tagBox = await tag.locator('span').first().boundingBox()
14
14
  const x = tagBox.x + tagBox.width
15
15
  const y = tagBox.y + tagBox.height - 5
16
16
 
@@ -10,7 +10,8 @@ test('多选复制单个标签', async ({ page }) => {
10
10
 
11
11
  await expect(tag).toContainText('北京')
12
12
  await page.waitForTimeout(200)
13
- const tagBox = await tag.locator('span').boundingBox()
13
+ // getByText 精确定位文本,.first() 避免多个 span 含相同文本导致 strict mode 冲突
14
+ const tagBox = await tag.getByText('北京').first().boundingBox()
14
15
  const x = tagBox.x + tagBox.width
15
16
  const y = tagBox.y + tagBox.height - 5
16
17
 
@@ -29,8 +29,8 @@ test('基本用法', async ({ page }) => {
29
29
  await expect(item1).toHaveCSS('color', 'rgb(25, 25, 25)')
30
30
  await expect(content).toHaveText(/表单组件/)
31
31
 
32
- // 禁用
33
- await item2.click()
32
+ // 禁用 - 使用 force: true 因为元素有 aria-disabled="true"
33
+ await item2.click({ force: true })
34
34
  await expect(item1).toHaveClass(/is-active/)
35
35
  await expect(content).toHaveText(/表单组件/)
36
36
  })
@@ -5,7 +5,8 @@ test('超长数据下拉展示全部,面板长宽可控', async ({ page }) =>
5
5
  await page.goto('tabs#more-show-all')
6
6
 
7
7
  const container = page.locator('#more-show-all')
8
- const showMoreBtn = container.getByRole('button')
8
+ // 使用更具体的选择器避免与滚动按钮冲突
9
+ const showMoreBtn = container.getByRole('button', { name: 'down' })
9
10
  const triggerBtn = container.locator('.tiny-tabs__more-container .tiny-dropdown__trigger.tiny-dropdown-trigger')
10
11
  const panel = page.locator('.tiny-tabs__more-dropdown')
11
12
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <tiny-tabs v-model="activeName" tab-style="card" :with-close="true" :before-close="beforeClose" @close="close">
2
+ <tiny-tabs v-model="activeName" :with-close="true" :before-close="beforeClose" @close="close">
3
3
  <tiny-tab-item
4
4
  :key="item.name"
5
5
  v-for="item in tabs"
@@ -14,7 +14,7 @@
14
14
 
15
15
  <script setup lang="jsx">
16
16
  import { ref, getCurrentInstance } from 'vue'
17
- import { TinyTabs, TinyTabItem } from '@opentiny/vue'
17
+ import { TinyTabs, TinyTabItem, TinyNotify } from '@opentiny/vue'
18
18
 
19
19
  const activeName = ref('first')
20
20
  const tabs = ref([
@@ -49,6 +49,12 @@ const instance = getCurrentInstance()
49
49
  const { $message } = instance.appContext.config.globalProperties
50
50
 
51
51
  function beforeClose(name) {
52
+ TinyNotify({
53
+ type: 'info',
54
+ title: 'beforeClose 事件',
55
+ message: '当前设置的beforeClose事件只能关闭标签页“其他组件”,点击其他标签页的关闭按钮将无法关闭。',
56
+ position: 'top-right'
57
+ })
52
58
  // 只能关闭标签页“其他组件”
53
59
  return name === 'fifth'
54
60
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <tiny-tabs v-model="activeName" tab-style="card" :with-close="true" :before-close="beforeClose" @close="close">
2
+ <tiny-tabs v-model="activeName" :with-close="true" :before-close="beforeClose" @close="close">
3
3
  <tiny-tab-item
4
4
  :key="item.name"
5
5
  v-for="item in tabs"
@@ -13,7 +13,7 @@
13
13
  </template>
14
14
 
15
15
  <script lang="jsx">
16
- import { TinyTabs, TinyTabItem } from '@opentiny/vue'
16
+ import { TinyTabs, TinyTabItem, Notify } from '@opentiny/vue'
17
17
 
18
18
  export default {
19
19
  components: {
@@ -55,6 +55,12 @@ export default {
55
55
  },
56
56
  methods: {
57
57
  beforeClose(name) {
58
+ Notify({
59
+ type: 'info',
60
+ title: 'beforeClose 事件',
61
+ message: '当前设置的beforeClose事件只能关闭标签页“其他组件”,点击其他标签页的关闭按钮将无法关闭。',
62
+ position: 'top-right'
63
+ })
58
64
  // 只能关闭标签页“其他组件”
59
65
  return name === 'fifth'
60
66
  },
@@ -4,7 +4,7 @@ test('配置式标签', async ({ page }) => {
4
4
  page.on('pageerror', (exception) => expect(exception).not.toBeNull())
5
5
  await page.goto('tag#basic-usage')
6
6
 
7
- const tag = page.locator('.all-demos-container').getByText('配置式标签')
7
+ const tag = page.locator('span').filter({ hasText: '配置式标签' }).first()
8
8
 
9
9
  await expect(tag).toHaveCount(1)
10
10
  })
@@ -5,8 +5,8 @@ test('边框和自定义背景色', async ({ page }) => {
5
5
  await page.goto('tag#color-border')
6
6
 
7
7
  const tags = page.locator('.all-demos-container').locator('.tiny-tag')
8
- const red = tags.getByText('red 标签')
9
- const custom = tags.getByText('自定义背景色', { exact: true })
8
+ const red = page.locator('span').filter({ hasText: 'red 标签' }).first()
9
+ const custom = page.locator('span').filter({ hasText: '自定义背景色' }).first()
10
10
 
11
11
  await expect(red).toHaveClass(/tiny-tag--red/)
12
12
  await expect(custom).toHaveCSS('background-color', 'rgba(82, 196, 26, 0.8)')
@@ -4,7 +4,7 @@ test('测试最大宽度', async ({ page }) => {
4
4
  page.on('pageerror', (exception) => expect(exception).not.toBeNull())
5
5
  await page.goto('tag#max-width')
6
6
 
7
- const normal = page.getByText('文本超长超长的标签')
7
+ const normal = page.getByLabel('示例', { exact: true }).locator('span').first()
8
8
 
9
9
  await expect(normal).toHaveCSS('max-width', '80px')
10
10
  })
@@ -4,9 +4,9 @@ test('各型号尺寸是否正常', async ({ page }) => {
4
4
  page.on('pageerror', (exception) => expect(exception).not.toBeNull())
5
5
  await page.goto('tag#size')
6
6
 
7
- const normal = page.getByText('默认标签')
8
- const medium = page.getByText('中等标签')
9
- const small = page.getByText('小型标签')
7
+ const normal = page.locator('span').filter({ hasText: '默认标签' }).first()
8
+ const medium = page.locator('span').filter({ hasText: '中等标签' }).first()
9
+ const small = page.locator('span').filter({ hasText: '小型标签' }).first()
10
10
 
11
11
  await expect(normal).toHaveCSS('height', '24px')
12
12
  await expect(medium).toHaveCSS('height', '32px')
@@ -3,9 +3,9 @@ import { expect, test } from '@playwright/test'
3
3
  test('图标是否正常显示', async ({ page }) => {
4
4
  page.on('pageerror', (exception) => expect(exception).not.toBeNull())
5
5
  await page.goto('tag#slot-default')
6
-
7
- const left = page.locator('.tiny-tag > svg:nth-child(1)').first()
8
- const right = page.locator('.tiny-tag > svg:nth-child(2)').first()
6
+
7
+ const left = page.getByLabel('示例', { exact: true }).getByRole('img').first()
8
+ const right = page.getByLabel('示例', { exact: true }).getByRole('img').nth(2)
9
9
 
10
10
  await expect(left).toBeVisible()
11
11
  await expect(right).toBeVisible()
@@ -6,23 +6,23 @@ test('TagGroup 基础用法', async ({ page }) => {
6
6
 
7
7
  const tagGroup = page.locator('.tiny-tag-group')
8
8
 
9
- const tag1 = tagGroup.getByText('标签一')
9
+ const tag1 = tagGroup.locator('.tiny-tag').nth(0)
10
10
  await expect(tag1).toHaveCSS('background-color', 'rgb(245, 245, 245)')
11
11
  await expect(tag1).toHaveCSS('color', 'rgb(25, 25, 25)')
12
12
 
13
- const tag2 = tagGroup.getByText('标签二')
13
+ const tag2 = tagGroup.locator('.tiny-tag').nth(1)
14
14
  await expect(tag2).toHaveCSS('background-color', 'rgb(222, 236, 255)')
15
15
  await expect(tag2).toHaveCSS('color', 'rgb(20, 118, 255)')
16
16
 
17
- const tag3 = tagGroup.getByText('标签三')
17
+ const tag3 = tagGroup.locator('.tiny-tag').nth(2)
18
18
  await expect(tag3).toHaveCSS('background-color', 'rgb(230, 242, 213)')
19
19
  await expect(tag3).toHaveCSS('color', 'rgb(92, 179, 0)')
20
20
 
21
- const tag4 = tagGroup.getByText('标签四')
21
+ const tag4 = tagGroup.locator('.tiny-tag').nth(3)
22
22
  await expect(tag4).toHaveCSS('background-color', 'rgb(255, 235, 209)')
23
23
  await expect(tag4).toHaveCSS('color', 'rgb(255, 136, 0)')
24
24
 
25
- const tag5 = tagGroup.getByText('标签五')
25
+ const tag5 = tagGroup.locator('.tiny-tag').nth(4)
26
26
  await expect(tag5).toHaveCSS('background-color', 'rgb(252, 227, 225)')
27
27
  await expect(tag5).toHaveCSS('color', 'rgb(242, 48, 48)')
28
28
  })
@@ -28,44 +28,44 @@ test('TagGroup 主题', async ({ page }) => {
28
28
  await expect(darkTag5).toHaveCSS('color', 'rgb(255, 255, 255)')
29
29
 
30
30
  // 浅色
31
- const lightTag1 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--light').filter({ hasText: '标签一' })
31
+ const lightTag1 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--medium.tiny-tag--light').filter({ hasText: '标签一' })
32
32
  await expect(lightTag1).toHaveCSS('background-color', 'rgb(245, 245, 245)')
33
33
  await expect(lightTag1).toHaveCSS('color', 'rgb(25, 25, 25)')
34
34
 
35
- const lightTag2 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--light').filter({ hasText: '标签二' })
35
+ const lightTag2 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--info.tiny-tag--medium.tiny-tag--light').filter({ hasText: '标签二' })
36
36
  await expect(lightTag2).toHaveCSS('background-color', 'rgb(222, 236, 255)')
37
37
  await expect(lightTag2).toHaveCSS('color', 'rgb(20, 118, 255)')
38
38
 
39
- const lightTag3 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--light').filter({ hasText: '标签三' })
39
+ const lightTag3 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--success.tiny-tag--medium.tiny-tag--light').filter({ hasText: '标签三' })
40
40
  await expect(lightTag3).toHaveCSS('background-color', 'rgb(230, 242, 213)')
41
41
  await expect(lightTag3).toHaveCSS('color', 'rgb(92, 179, 0)')
42
42
 
43
- const lightTag4 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--light').filter({ hasText: '标签四' })
43
+ const lightTag4 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--warning.tiny-tag--medium.tiny-tag--light').filter({ hasText: '标签四' })
44
44
  await expect(lightTag4).toHaveCSS('background-color', 'rgb(255, 235, 209)')
45
45
  await expect(lightTag4).toHaveCSS('color', 'rgb(255, 136, 0)')
46
46
 
47
- const lightTag5 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--light').filter({ hasText: '标签五' })
47
+ const lightTag5 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--danger.tiny-tag--medium.tiny-tag--light').filter({ hasText: '标签五' })
48
48
  await expect(lightTag5).toHaveCSS('background-color', 'rgb(252, 227, 225)')
49
49
  await expect(lightTag5).toHaveCSS('color', 'rgb(242, 48, 48)')
50
50
 
51
51
  // plain
52
- const plainTag1 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--plain').filter({ hasText: '标签一' })
52
+ const plainTag1 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--medium.tiny-tag--plain').filter({ hasText: '标签一' })
53
53
  await expect(plainTag1).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
54
54
  await expect(plainTag1).toHaveCSS('color', 'rgb(25, 25, 25)')
55
55
 
56
- const plainTag2 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--plain').filter({ hasText: '标签二' })
56
+ const plainTag2 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--info.tiny-tag--medium.tiny-tag--plain').filter({ hasText: '标签二' })
57
57
  await expect(plainTag2).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
58
58
  await expect(plainTag2).toHaveCSS('color', 'rgb(20, 118, 255)')
59
59
 
60
- const plainTag3 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--plain').filter({ hasText: '标签三' })
60
+ const plainTag3 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--success.tiny-tag--medium.tiny-tag--plain').filter({ hasText: '标签三' })
61
61
  await expect(plainTag3).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
62
62
  await expect(plainTag3).toHaveCSS('color', 'rgb(92, 179, 0)')
63
63
 
64
- const plainTag4 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--plain').filter({ hasText: '标签四' })
64
+ const plainTag4 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--warning.tiny-tag--medium.tiny-tag--plain').filter({ hasText: '标签四' })
65
65
  await expect(plainTag4).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
66
66
  await expect(plainTag4).toHaveCSS('color', 'rgb(255, 136, 0)')
67
67
 
68
- const plainTag5 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--plain').filter({ hasText: '标签五' })
68
+ const plainTag5 = tagGroupsLocator.locator('.tiny-tag.tiny-tag--danger.tiny-tag--medium.tiny-tag--plain').filter({ hasText: '标签五' })
69
69
  await expect(plainTag5).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
70
70
  await expect(plainTag5).toHaveCSS('color', 'rgb(242, 48, 48)')
71
71
  })
@@ -4,7 +4,7 @@ test('TagGroup 事件', async ({ page }) => {
4
4
  page.on('pageerror', (exception) => expect(exception).toBeNull())
5
5
  await page.goto('tag-group#tag-group-event')
6
6
 
7
- const tag3 = page.locator('.tiny-tag ').filter({ hasText: '标签二' })
7
+ const tag3 = page.locator('.tiny-tag > span').filter({ hasText: '标签二' })
8
8
  await tag3.click()
9
9
 
10
10
  await expect(page.locator('.tiny-modal__box').filter({ hasText: '当前点击的是第 2 个标签' })).toBeVisible()
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <div class="tiny-tag-input-demo">
3
+ <tiny-tag-input v-model="data" :placeholder="placeholder"></tiny-tag-input>
4
+ <tiny-tag-input
5
+ v-model="data1"
6
+ :placeholder="placeholder"
7
+ tag-type="info"
8
+ tag-effect="light"
9
+ disabled
10
+ ></tiny-tag-input>
11
+ <tiny-tag-input v-model="data2" :placeholder="placeholder" tag-type="success" tag-effect="plain"></tiny-tag-input>
12
+ </div>
13
+ </template>
14
+
15
+ <script setup>
16
+ import { TinyTagInput } from '@opentiny/vue'
17
+ import { reactive, ref } from 'vue'
18
+
19
+ const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
20
+ const data1 = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
21
+ const data2 = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
22
+ const placeholder = ref('please enter a tag')
23
+ </script>
24
+
25
+ <style scoped>
26
+ .tiny-tag-input-demo .tiny-tag-input {
27
+ margin-bottom: 20px;
28
+ }
29
+ </style>
File without changes
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <div class="tiny-tag-input-demo">
3
+ <tiny-tag-input v-model="data" :placeholder="placeholder"></tiny-tag-input>
4
+ <tiny-tag-input
5
+ v-model="data1"
6
+ :placeholder="placeholder"
7
+ tag-type="info"
8
+ tag-effect="light"
9
+ disabled
10
+ ></tiny-tag-input>
11
+ <tiny-tag-input v-model="data2" :placeholder="placeholder" tag-type="success" tag-effect="plain"></tiny-tag-input>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ import { TinyTagInput } from '@opentiny/vue'
17
+
18
+ export default {
19
+ components: {
20
+ TinyTagInput
21
+ },
22
+ data() {
23
+ return {
24
+ data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
25
+ data1: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
26
+ data2: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
27
+ maxTagCount: 3,
28
+ placeholder: 'please enter a tag'
29
+ }
30
+ }
31
+ }
32
+ </script>
33
+
34
+ <style scoped>
35
+ .tiny-tag-input-demo .tiny-tag-input {
36
+ margin-bottom: 20px;
37
+ }
38
+ </style>
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <div class="tiny-tag-input-demo">
3
+ <tiny-tag-input v-model="data" :placeholder="placeholder" clearable></tiny-tag-input>
4
+ </div>
5
+ </template>
6
+
7
+ <script setup>
8
+ import { TinyTagInput } from '@opentiny/vue'
9
+ import { reactive, ref } from 'vue'
10
+
11
+ const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
12
+
13
+ const placeholder = ref('please enter a tag')
14
+ </script>
15
+
16
+ <style scoped>
17
+ .tiny-tag-input-demo .tiny-tag-input {
18
+ margin-bottom: 20px;
19
+ }
20
+ </style>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div class="tiny-tag-input-demo">
3
+ <tiny-tag-input v-model="data" :placeholder="placeholder" clearable></tiny-tag-input>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ import { TinyTagInput } from '@opentiny/vue'
9
+
10
+ export default {
11
+ components: {
12
+ TinyTagInput
13
+ },
14
+ data() {
15
+ return {
16
+ data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
17
+ placeholder: 'please enter a tag'
18
+ }
19
+ }
20
+ }
21
+ </script>
22
+
23
+ <style scoped>
24
+ .tiny-tag-input-demo .tiny-tag-input {
25
+ margin-bottom: 20px;
26
+ }
27
+ </style>