@opentiny/vue-docs 2.2.5 → 2.2.6
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.
- package/demos/mobile/app/container/basic-usage.vue +105 -0
- package/demos/mobile/app/container/custom-width.vue +93 -0
- package/demos/mobile/app/container/webdoc/container.cn.md +7 -0
- package/demos/mobile/app/container/webdoc/container.en.md +7 -0
- package/demos/mobile/app/container/webdoc/container.js +80 -0
- package/demos/mobile/app/pull-refresh/animation-duration.vue +58 -12
- package/demos/mobile/app/pull-refresh/base.vue +32 -18
- package/demos/mobile/app/pull-refresh/disabled-pull-down.vue +66 -0
- package/demos/mobile/app/pull-refresh/disabled-pull-up.vue +67 -0
- package/demos/mobile/app/pull-refresh/{hasmore.vue → event.vue} +21 -20
- package/demos/mobile/app/pull-refresh/{enhance.vue → has-more.vue} +20 -25
- package/demos/mobile/app/pull-refresh/loosing-text.vue +55 -12
- package/demos/mobile/app/pull-refresh/pull-refresh-slot.vue +64 -15
- package/demos/mobile/app/pull-refresh/pull-up-distance.vue +74 -0
- package/demos/mobile/app/pull-refresh/pulling-text.vue +56 -12
- package/demos/mobile/app/pull-refresh/webdoc/pull-refresh.js +98 -120
- package/demos/mobile/app/tabs/before-leave.vue +3 -3
- package/demos/mobile/app/tabs/tabs-events.vue +7 -7
- package/demos/mobile/menus.js +4 -1
- package/demos/mobile-first/app/tabs/basic-usage.vue +3 -3
- package/demos/mobile-first/app/tabs/before-leave.vue +3 -3
- package/demos/mobile-first/app/tabs/change-title.vue +2 -2
- package/demos/mobile-first/app/tabs/custom-tab-content.vue +3 -3
- package/demos/mobile-first/app/tabs/custom-tab-title.vue +3 -3
- package/demos/mobile-first/app/tabs/position-bottom.vue +10 -10
- package/demos/mobile-first/app/tabs/position-left.vue +10 -10
- package/demos/mobile-first/app/tabs/position-right.vue +10 -10
- package/demos/mobile-first/app/tabs/position.vue +10 -10
- package/demos/mobile-first/app/tabs/prevent-tab-switching.vue +3 -3
- package/demos/mobile-first/app/tabs/stretch-wh.vue +3 -3
- package/demos/mobile-first/app/tabs/tab-style-bordercard.vue +10 -10
- package/demos/mobile-first/app/tabs/tab-style-card.vue +10 -10
- package/demos/mobile-first/app/tabs/tabdata-title.vue +4 -4
- package/demos/mobile-first/app/tabs/tabs-draggable.vue +1 -1
- package/demos/mobile-first/app/tabs/tabs-events-add.vue +3 -3
- package/demos/mobile-first/app/tabs/tabs-events-click.vue +3 -3
- package/demos/mobile-first/app/tabs/tabs-events-close.vue +4 -4
- package/demos/mobile-first/app/tabs/tabs-events-edit.vue +4 -4
- package/demos/mobile-first/app/tabs/tabs-separator.vue +8 -8
- package/demos/mobile-first/app/tabs/tabs-size.vue +3 -3
- package/demos/mobile-first/app/tabs/tabs-tabs.vue +2 -2
- package/demos/mobile-first/app/tabs/with-add.vue +1 -1
- package/demos/pc/app/action-menu/disabled.vue +2 -1
- package/demos/pc/app/action-menu/icon-composition-api.vue +73 -0
- package/demos/pc/app/action-menu/icon.vue +79 -0
- package/demos/pc/app/action-menu/popper-class.spec.ts +2 -1
- package/demos/pc/app/action-menu/webdoc/action-menu.js +42 -1
- package/demos/pc/app/autocomplete/webdoc/autocomplete.js +30 -16
- package/demos/pc/app/breadcrumb/webdoc/breadcrumb.js +3 -3
- package/demos/pc/app/button/basic-usage-composition-api.vue +2 -0
- package/demos/pc/app/button/basic-usage.vue +2 -0
- package/demos/pc/app/button/click-composition-api.vue +1 -1
- package/demos/pc/app/button/click.vue +1 -1
- package/demos/pc/app/button/dynamic-disabled-composition-api.vue +10 -1
- package/demos/pc/app/button/{dynamic-disabled.spec.js → dynamic-disabled.spec.ts} +4 -0
- package/demos/pc/app/button/dynamic-disabled.vue +12 -3
- package/demos/pc/app/button/ghost-composition-api.vue +26 -0
- package/demos/pc/app/button/ghost.spec.ts +69 -0
- package/demos/pc/app/button/ghost.vue +32 -0
- package/demos/pc/app/button/icon-composition-api.vue +2 -0
- package/demos/pc/app/button/icon.vue +2 -0
- package/demos/pc/app/button/loading-composition-api.vue +2 -0
- package/demos/pc/app/button/loading.vue +2 -0
- package/demos/pc/app/button/size-composition-api.vue +2 -0
- package/demos/pc/app/button/size.vue +2 -0
- package/demos/pc/app/button/text-composition-api.vue +1 -1
- package/demos/pc/app/button/text.vue +1 -1
- package/demos/pc/app/button/webdoc/button.js +28 -1
- package/demos/pc/app/button-group/button-group-multiple-composition-api.vue +9 -9
- package/demos/pc/app/button-group/button-group-multiple.vue +9 -9
- package/demos/pc/app/button-group/change-event-composition-api.vue +1 -1
- package/demos/pc/app/button-group/change-event.vue +1 -1
- package/demos/pc/app/button-group/show-edit-composition-api.vue +1 -1
- package/demos/pc/app/button-group/show-edit.vue +1 -1
- package/demos/pc/app/button-group/webdoc/button-group.js +2 -3
- package/demos/pc/app/carousel/webdoc/carousel.js +82 -49
- package/demos/pc/app/cascader/auto-load-checkStrictly-composition-api.vue +2 -1
- package/demos/pc/app/cascader/auto-load-checkStrictly.vue +2 -1
- package/demos/pc/app/cascader/auto-load-composition-api.vue +3 -1
- package/demos/pc/app/cascader/auto-load.vue +2 -1
- package/demos/pc/app/cascader/events-composition-api.vue +1 -1
- package/demos/pc/app/cascader/expand-trigger-composition-api.vue +195 -2
- package/demos/pc/app/cascader/show-all-levels-composition-api.vue +197 -2
- package/demos/pc/app/cascader/webdoc/cascader.js +27 -13
- package/demos/pc/app/cascader-panel/basic-usage-composition-api.vue +3 -1
- package/demos/pc/app/cascader-panel/basic-usage.vue +2 -1
- package/demos/pc/app/cascader-panel/cascader-panel-props-composition-api.vue +3 -1
- package/demos/pc/app/cascader-panel/cascader-panel-props.vue +3 -1
- package/demos/pc/app/cascader-panel/change-composition-api.vue +1 -2
- package/demos/pc/app/cascader-panel/change.vue +1 -1
- package/demos/pc/app/cascader-panel/webdoc/cascader-panel.js +5 -5
- package/demos/pc/app/color-picker/webdoc/color-picker.js +36 -18
- package/demos/pc/app/color-select-panel/webdoc/color-select-panel.js +32 -19
- package/demos/pc/app/config-provider/basic.spec.ts +9 -0
- package/demos/pc/app/config-provider/tag.spec.ts +12 -0
- package/demos/pc/app/config-provider/text-direct.spec.ts +11 -0
- package/demos/pc/app/config-provider/webdoc/config-provider.en.md +7 -0
- package/demos/pc/app/config-provider/webdoc/config-provider.js +27 -12
- package/demos/pc/app/container/basic-usage.spec.js +47 -2
- package/demos/pc/app/container/custom-with-height.spec.js +10 -2
- package/demos/pc/app/crop/webdoc/crop.js +53 -49
- package/demos/pc/app/dialog-box/webdoc/dialog-box.js +82 -83
- package/demos/pc/app/divider/webdoc/divider.js +25 -21
- package/demos/pc/app/dropdown/events-composition-api.vue +1 -1
- package/demos/pc/app/dropdown/events.spec.ts +1 -0
- package/demos/pc/app/dropdown/multi-level-composition-api.vue +4 -8
- package/demos/pc/app/dropdown/multi-level.spec.ts +16 -9
- package/demos/pc/app/dropdown/multi-level.vue +3 -7
- package/demos/pc/app/dropdown/show-icon-composition-api.vue +44 -21
- package/demos/pc/app/dropdown/show-icon.vue +42 -12
- package/demos/pc/app/dropdown/webdoc/dropdown.js +29 -8
- package/demos/pc/app/fall-menu/custom-menuitem.spec.ts +6 -9
- package/demos/pc/app/fall-menu/custom-slider-icon.spec.ts +10 -21
- package/demos/pc/app/fall-menu/data-resource.spec.ts +6 -9
- package/demos/pc/app/file-upload/abort-quest.spec.ts +6 -5
- package/demos/pc/app/file-upload/accept-file-image.spec.ts +9 -4
- package/demos/pc/app/file-upload/custom-trigger.spec.ts +1 -1
- package/demos/pc/app/file-upload/disabled.spec.ts +4 -5
- package/demos/pc/app/file-upload/drag-upload.spec.ts +1 -1
- package/demos/pc/app/file-upload/file-picture-card.spec.ts +7 -6
- package/demos/pc/app/file-upload/form-validation.spec.ts +2 -2
- package/demos/pc/app/file-upload/image-size.spec.ts +2 -2
- package/demos/pc/app/file-upload/max-file-count.spec.ts +6 -6
- package/demos/pc/app/file-upload/paste-upload-composition-api.vue +2 -2
- package/demos/pc/app/file-upload/paste-upload.spec.ts +19 -2
- package/demos/pc/app/file-upload/picture-card.spec.ts +6 -5
- package/demos/pc/app/file-upload/picture-list.spec.ts +2 -3
- package/demos/pc/app/file-upload/prevent-delete-file.spec.ts +1 -1
- package/demos/pc/app/file-upload/prevent-upload-file.spec.ts +1 -1
- package/demos/pc/app/file-upload/upload-events.spec.ts +6 -4
- package/demos/pc/app/file-upload/upload-file-list-slot.spec.ts +18 -0
- package/demos/pc/app/file-upload/upload-file-list-thumb-composition-api.vue +4 -3
- package/demos/pc/app/file-upload/upload-file-list-thumb.spec.ts +2 -2
- package/demos/pc/app/file-upload/upload-file-list-thumb.vue +4 -3
- package/demos/pc/app/file-upload/upload-file-list.spec.ts +9 -9
- package/demos/pc/app/file-upload/upload-limit.spec.ts +5 -8
- package/demos/pc/app/file-upload/upload-request.spec.ts +1 -1
- package/demos/pc/app/file-upload/upload-user-head.spec.ts +1 -1
- package/demos/pc/app/file-upload/webdoc/file-upload.js +4 -4
- package/demos/pc/app/file-upload//346/265/213/350/257/225.txt +1 -0
- package/demos/pc/app/form/custom-validation-rule-composition-api.vue +2 -14
- package/demos/pc/app/form/custom-validation-rule.vue +2 -8
- package/demos/pc/app/form/form-validate-field.vue +2 -2
- package/demos/pc/app/form/size.spec.ts +26 -6
- package/demos/pc/app/grid/custom-style/body-style-composition-api.vue +1 -1
- package/demos/pc/app/grid/custom-style/footer-style-composition-api.vue +64 -19
- package/demos/pc/app/grid/drag/row-drag-ctrl-composition-api.vue +4 -4
- package/demos/pc/app/grid/edit/trigger-mode-hm-editing-composition-api.vue +2 -2
- package/demos/pc/app/grid/edit/trigger-mode-hm-editing.vue +1 -1
- package/demos/pc/app/grid/event/cell-mouse-event-composition-api.vue +1 -1
- package/demos/pc/app/grid/event/context-menu-event-composition-api.vue +1 -0
- package/demos/pc/app/grid/event/edit-event-composition-api.vue +1 -1
- package/demos/pc/app/grid/expand/set-row-expansion-composition-api.vue +9 -4
- package/demos/pc/app/grid/loading/{grid-loading-off-tip-composition-api.vue → grid-custom-loading-composition-api.vue} +29 -4
- package/demos/pc/app/grid/loading/grid-custom-loading.spec.js +7 -0
- package/demos/pc/app/grid/loading/{grid-loading-off-tip.vue → grid-custom-loading.vue} +27 -1
- package/demos/pc/app/grid/operation-column/clear-and-set-radio-row-composition-api.vue +5 -1
- package/demos/pc/app/grid/operation-column/selection-operation-composition-api.vue +32 -0
- package/demos/pc/app/grid/size/grid-size-composition-api.vue +17 -0
- package/demos/pc/app/grid/slot/editor-slot-composition-api.vue +13 -7
- package/demos/pc/app/grid/sort/combinations-sort-composition-api.vue +3 -3
- package/demos/pc/app/grid/sort/combinations-sort.spec.js +3 -0
- package/demos/pc/app/grid/sort/combinations-sort.vue +3 -3
- package/demos/pc/app/grid/toolbar/insert-remove-rows-composition-api.vue +1 -1
- package/demos/pc/app/grid/toolbar/insert-remove-rows.vue +1 -1
- package/demos/pc/app/grid/toolbar/refresh-grid-composition-api.vue +105 -0
- package/demos/pc/app/grid/tree-table/set-tree-expansion-composition-api.vue +4 -4
- package/demos/pc/app/grid/validation/before-submit-validation-composition-api.vue +19 -2
- package/demos/pc/app/grid/validation/before-submit-validation.spec.js +5 -2
- package/demos/pc/app/grid/validation/before-submit-validation.vue +19 -2
- package/demos/pc/app/grid/webdoc/grid-loading.js +9 -5
- package/demos/pc/app/grid/webdoc/grid-size.js +2 -2
- package/demos/pc/app/grid/webdoc/grid-validation.js +1 -1
- package/demos/pc/app/grid/webdoc/grid.js +8 -1
- package/demos/pc/app/guide/callback-composition-api.vue +2 -2
- package/demos/pc/app/guide/callback.vue +2 -2
- package/demos/pc/app/guide/highlight-box-composition-api.vue +9 -8
- package/demos/pc/app/guide/highlight-box.vue +8 -2
- package/demos/pc/app/guide/offset-composition-api.vue +7 -2
- package/demos/pc/app/guide/offset.vue +7 -2
- package/demos/pc/app/guide/size-composition-api.vue +3 -8
- package/demos/pc/app/guide/size.vue +3 -8
- package/demos/pc/app/guide/webdoc/guide.js +2 -2
- package/demos/pc/app/image/basic-usage.spec.ts +9 -2
- package/demos/pc/app/image/events.spec.ts +3 -1
- package/demos/pc/app/image/lazy-composition-api.vue +2 -2
- package/demos/pc/app/image/lazy.spec.ts +7 -4
- package/demos/pc/app/image/lazy.vue +2 -2
- package/demos/pc/app/image/preview-in-dialog.spec.ts +15 -1
- package/demos/pc/app/image/preview.spec.ts +28 -13
- package/demos/pc/app/image/slot.spec.ts +3 -0
- package/demos/pc/app/input/webdoc/input.js +11 -11
- package/demos/pc/app/link/basic-usage-composition-api.vue +1 -1
- package/demos/pc/app/link/basic-usage.spec.ts +1 -1
- package/demos/pc/app/link/basic-usage.vue +1 -1
- package/demos/pc/app/link/config-href.spec.ts +2 -2
- package/demos/pc/app/link/custom-icon.spec.ts +5 -5
- package/demos/pc/app/link/dynamic-disable.spec.ts +11 -11
- package/demos/pc/app/link/focus-no-underline.spec.ts +3 -3
- package/demos/pc/app/link/link-style-composition-api.vue +6 -6
- package/demos/pc/app/link/link-style.spec.ts +36 -7
- package/demos/pc/app/link/link-style.vue +6 -6
- package/demos/pc/app/link/webdoc/link.js +20 -22
- package/demos/pc/app/link-menu/webdoc/link-menu.js +22 -22
- package/demos/pc/app/milestone/basic-usage-composition-api.vue +6 -6
- package/demos/pc/app/milestone/basic-usage.spec.ts +1 -1
- package/demos/pc/app/milestone/basic-usage.vue +6 -6
- package/demos/pc/app/milestone/line-style-composition-api.vue +6 -6
- package/demos/pc/app/milestone/line-style.vue +6 -6
- package/demos/pc/app/milestone/show-number-composition-api.vue +9 -7
- package/demos/pc/app/milestone/show-number.spec.ts +7 -7
- package/demos/pc/app/milestone/show-number.vue +9 -7
- package/demos/pc/app/milestone/solid-style-composition-api.vue +7 -7
- package/demos/pc/app/milestone/solid-style.spec.ts +7 -7
- package/demos/pc/app/milestone/solid-style.vue +7 -7
- package/demos/pc/app/milestone/webdoc/milestone.js +31 -12
- package/demos/pc/app/modal/webdoc/modal.js +80 -76
- package/demos/pc/app/nav-menu/basic-usage.spec.ts +2 -2
- package/demos/pc/app/nav-menu/before-skip-prevent.spec.ts +1 -1
- package/demos/pc/app/nav-menu/before-skip.spec.ts +1 -1
- package/demos/pc/app/nav-menu/custom-service.spec.ts +1 -2
- package/demos/pc/app/nav-menu/overflow.spec.ts +2 -2
- package/demos/pc/app/nav-menu/slot-logo.spec.ts +1 -1
- package/demos/pc/app/nav-menu/slot-toolbar.spec.ts +2 -2
- package/demos/pc/app/numeric/webdoc/numeric.js +33 -32
- package/demos/pc/app/search/basic-usage.spec.ts +1 -1
- package/demos/pc/app/search/clearable.spec.ts +1 -1
- package/demos/pc/app/search/events-composition-api.vue +6 -0
- package/demos/pc/app/search/events.spec.ts +9 -6
- package/demos/pc/app/search/events.vue +5 -0
- package/demos/pc/app/search/webdoc/search.js +14 -4
- package/demos/pc/app/slide-bar/webdoc/slide-bar.js +18 -12
- package/demos/pc/app/slider/webdoc/slider.js +23 -18
- package/demos/pc/app/steps/advanced-steps.spec.ts +3 -2
- package/demos/pc/app/steps/click-composition-api.vue +0 -1
- package/demos/pc/app/steps/click.spec.ts +1 -12
- package/demos/pc/app/steps/custom-steps-item.spec.ts +1 -1
- package/demos/pc/app/steps/node-status-composition-api.vue +1 -1
- package/demos/pc/app/steps/node-status.spec.ts +1 -1
- package/demos/pc/app/steps/node-status.vue +1 -1
- package/demos/pc/app/steps/normal-steps-composition-api.vue +1 -1
- package/demos/pc/app/steps/normal-steps.spec.ts +2 -2
- package/demos/pc/app/steps/normal-steps.vue +1 -1
- package/demos/pc/app/steps/only-number-composition-api.vue +1 -1
- package/demos/pc/app/steps/only-number.spec.ts +1 -1
- package/demos/pc/app/steps/only-number.vue +1 -1
- package/demos/pc/app/steps/show-divider-composition-api.vue +1 -1
- package/demos/pc/app/steps/show-divider.spec.ts +1 -1
- package/demos/pc/app/steps/show-divider.vue +1 -1
- package/demos/pc/app/steps/size-composition-api.vue +6 -9
- package/demos/pc/app/steps/size.spec.ts +1 -4
- package/demos/pc/app/steps/size.vue +4 -4
- package/demos/pc/app/steps/slot-active-node-desc-composition-api.vue +3 -1
- package/demos/pc/app/steps/slot-active-node-desc.spec.ts +1 -1
- package/demos/pc/app/steps/slot-active-node-desc.vue +3 -1
- package/demos/pc/app/steps/slot-description-composition-api.vue +6 -6
- package/demos/pc/app/steps/slot-description.spec.ts +1 -1
- package/demos/pc/app/steps/slot-description.vue +5 -5
- package/demos/pc/app/steps/slot-item-composition-api.vue +0 -1
- package/demos/pc/app/steps/slot-item.spec.ts +1 -7
- package/demos/pc/app/steps/slot-item.vue +0 -1
- package/demos/pc/app/steps/space.spec.ts +1 -1
- package/demos/pc/app/steps/text-position-composition-api.vue +1 -1
- package/demos/pc/app/steps/text-position.spec.ts +1 -4
- package/demos/pc/app/steps/text-position.vue +1 -1
- package/demos/pc/app/steps/vertical-steps.spec.ts +13 -19
- package/demos/pc/app/steps/webdoc/steps.js +18 -17
- package/demos/pc/app/tabs/basic-usage-composition-api.vue +4 -4
- package/demos/pc/app/tabs/basic-usage.vue +4 -4
- package/demos/pc/app/tabs/before-leave-composition-api.vue +3 -3
- package/demos/pc/app/tabs/before-leave.vue +3 -3
- package/demos/pc/app/tabs/custom-more-icon-composition-api.vue +1 -1
- package/demos/pc/app/tabs/custom-more-icon.vue +1 -1
- package/demos/pc/app/tabs/custom-tab-content-composition-api.vue +3 -3
- package/demos/pc/app/tabs/custom-tab-content.vue +3 -3
- package/demos/pc/app/tabs/custom-tab-title-composition-api.vue +3 -3
- package/demos/pc/app/tabs/custom-tab-title.vue +3 -3
- package/demos/pc/app/tabs/lazy-composition-api.vue +5 -3
- package/demos/pc/app/tabs/lazy.vue +5 -3
- package/demos/pc/app/tabs/position-composition-api.vue +22 -17
- package/demos/pc/app/tabs/position.spec.ts +4 -4
- package/demos/pc/app/tabs/position.vue +19 -18
- package/demos/pc/app/tabs/prevent-tab-switching-composition-api.vue +3 -3
- package/demos/pc/app/tabs/prevent-tab-switching.vue +3 -3
- package/demos/pc/app/tabs/stretch-wh-composition-api.vue +3 -3
- package/demos/pc/app/tabs/stretch-wh.vue +3 -3
- package/demos/pc/app/tabs/tab-style-bordercard-composition-api.vue +10 -10
- package/demos/pc/app/tabs/tab-style-bordercard.vue +10 -10
- package/demos/pc/app/tabs/tab-style-card-composition-api.vue +1 -1
- package/demos/pc/app/tabs/tab-style-card.vue +1 -1
- package/demos/pc/app/tabs/tabs-draggable-composition-api.vue +1 -1
- package/demos/pc/app/tabs/tabs-draggable.spec.ts +1 -7
- package/demos/pc/app/tabs/tabs-draggable.vue +1 -1
- package/demos/pc/app/tabs/tabs-events-click-composition-api.vue +3 -3
- package/demos/pc/app/tabs/tabs-events-click.vue +3 -3
- package/demos/pc/app/tabs/tabs-events-close-composition-api.vue +4 -4
- package/demos/pc/app/tabs/tabs-events-close.vue +4 -4
- package/demos/pc/app/tabs/tabs-events-edit-composition-api.vue +4 -4
- package/demos/pc/app/tabs/tabs-events-edit.vue +4 -4
- package/demos/pc/app/tabs/tabs-separator-composition-api.vue +7 -7
- package/demos/pc/app/tabs/tabs-separator.vue +7 -7
- package/demos/pc/app/tabs/tabs-size-composition-api.vue +3 -3
- package/demos/pc/app/tabs/tabs-size.vue +3 -3
- package/demos/pc/app/tabs/tooltip-composition-api.vue +17 -13
- package/demos/pc/app/tabs/tooltip.vue +17 -13
- package/demos/pc/app/tabs/webdoc/tabs.js +35 -35
- package/demos/pc/app/tabs/with-add-composition-api.vue +1 -1
- package/demos/pc/app/tabs/with-add.vue +1 -1
- package/demos/pc/app/tag/{before-delete-composition-api.vue → delete-composition-api.vue} +6 -16
- package/demos/pc/app/tag/delete.spec.ts +19 -0
- package/demos/pc/app/tag/{closable.vue → delete.vue} +22 -5
- package/demos/pc/app/tag/webdoc/tag.js +15 -7
- package/demos/pc/app/time-line/webdoc/time-line.js +12 -12
- package/demos/pc/app/toggle-menu/webdoc/toggle-menu.js +64 -55
- package/demos/pc/app/tooltip/content.spec.js +1 -1
- package/demos/pc/app/tooltip/custom-popper.spec.js +4 -4
- package/demos/pc/app/transfer/basic-usage.spec.ts +7 -20
- package/demos/pc/app/transfer/custom-btns.spec.ts +11 -19
- package/demos/pc/app/transfer/custom-filter.spec.ts +6 -4
- package/demos/pc/app/transfer/custom-footer.spec.ts +1 -2
- package/demos/pc/app/transfer/custom-render.spec.ts +7 -5
- package/demos/pc/app/transfer/custom-titles.spec.ts +5 -3
- package/demos/pc/app/transfer/default-checked.spec.ts +5 -9
- package/demos/pc/app/transfer/drop-config.spec.ts +21 -16
- package/demos/pc/app/transfer/manual-clear-query.spec.ts +2 -2
- package/demos/pc/app/transfer/nested-table.spec.ts +12 -35
- package/demos/pc/app/transfer/nested-tree.spec.ts +3 -30
- package/demos/pc/app/transfer/target-order.spec.ts +2 -1
- package/demos/pc/app/transfer/transfer-events.spec.ts +2 -1
- package/demos/pc/app/tree/basic-usage.spec.ts +26 -16
- package/demos/pc/app/tree/check-op.spec.ts +37 -19
- package/demos/pc/app/tree/checkbox.spec.ts +23 -18
- package/demos/pc/app/tree/contextmenu.spec.ts +9 -8
- package/demos/pc/app/tree/drag.spec.ts +10 -18
- package/demos/pc/app/tree/edit.spec.ts +24 -103
- package/demos/pc/app/tree/expand-control.spec.ts +22 -18
- package/demos/pc/app/tree/filter-view.spec.ts +16 -18
- package/demos/pc/app/tree/icons.spec.ts +20 -18
- package/demos/pc/app/tree/lazy.spec.ts +10 -18
- package/demos/pc/app/tree/node-hl.spec.ts +27 -18
- package/demos/pc/app/tree/node-op-composition-api.vue +12 -6
- package/demos/pc/app/tree/node-op.spec.ts +32 -19
- package/demos/pc/app/tree/other.spec.ts +5 -18
- package/demos/pc/app/tree/props.spec.ts +7 -18
- package/demos/pc/app/tree/radio.spec.ts +10 -18
- package/demos/pc/app/tree/slot.spec.ts +12 -18
- package/demos/pc/app/tree/webdoc/tree.js +2 -2
- package/demos/pc/app/tree-menu/accordion.spec.ts +3 -1
- package/demos/pc/app/tree-menu/basic-usage.spec.ts +4 -2
- package/demos/pc/app/tree-menu/current-node-composition-api.vue +7 -3
- package/demos/pc/app/tree-menu/current-node.spec.ts +20 -13
- package/demos/pc/app/tree-menu/current-node.vue +8 -6
- package/demos/pc/app/tree-menu/custom-icon.spec.ts +12 -2
- package/demos/pc/app/tree-menu/data-resource.spec.ts +33 -21
- package/demos/pc/app/tree-menu/default-expand-all.spec.ts +25 -8
- package/demos/pc/app/tree-menu/default-expanded-keys-highlight.spec.ts +6 -4
- package/demos/pc/app/tree-menu/default-expanded-keys.spec.ts +11 -7
- package/demos/pc/app/tree-menu/draggable.spec.ts +11 -4
- package/demos/pc/app/tree-menu/empty-text.spec.ts +1 -1
- package/demos/pc/app/tree-menu/event-allow-draggable.spec.ts +4 -1
- package/demos/pc/app/tree-menu/events.spec.ts +56 -28
- package/demos/pc/app/tree-menu/expand-on-click-node.spec.ts +32 -3
- package/demos/pc/app/tree-menu/filter-node-method.spec.ts +9 -6
- package/demos/pc/app/tree-menu/filter-node-method.vue +0 -4
- package/demos/pc/app/tree-menu/indent.spec.ts +9 -4
- package/demos/pc/app/tree-menu/lazy-load.spec.ts +8 -4
- package/demos/pc/app/tree-menu/menu-collapsible.spec.ts +5 -2
- package/demos/pc/app/tree-menu/show-checkbox.spec.ts +79 -41
- package/demos/pc/app/tree-menu/text-ellipsis.spec.ts +7 -4
- package/demos/pc/app/tree-menu/tree-menu-slot.spec.ts +4 -3
- package/demos/pc/app/tree-menu/webdoc/tree-menu.cn.md +1 -1
- package/demos/pc/app/tree-menu/webdoc/tree-menu.en.md +1 -1
- package/demos/pc/app/tree-menu/webdoc/tree-menu.js +3 -3
- package/demos/pc/app/user-contact/webdoc/user-contact.js +21 -13
- package/demos/pc/app/user-head/icon-user-head.spec.ts +3 -3
- package/demos/pc/app/user-head/image-user-head.spec.ts +2 -2
- package/demos/pc/app/user-head/webdoc/user-head.js +44 -28
- package/demos/pc/webdoc/import-components.md +2 -4
- package/demos/pc/webdoc/theme-en.md +8 -4
- package/demos/pc/webdoc/theme.md +10 -3
- package/package.json +5 -5
- package/src/App.vue +0 -2
- package/src/i18n/index.js +3 -3
- package/src/main.js +2 -7
- package/src/menus.jsx +1 -1
- package/src/tools/useApiMode.js +2 -2
- package/src/tools/utils.js +2 -2
- package/src/views/components/VersionTip.vue +14 -8
- package/src/views/components/components.vue +36 -37
- package/src/views/components/demo.vue +11 -11
- package/src/views/docs/docs.vue +2 -3
- package/src/views/layout/layout.vue +17 -19
- package/src/views/overview.vue +16 -13
- package/vite.config.ts +10 -4
- package/demos/mobile/app/pull-refresh/disabled.vue +0 -57
- package/demos/mobile/app/pull-refresh/head-height.vue +0 -31
- package/demos/mobile/app/pull-refresh/result-text.vue +0 -46
- package/demos/mobile/app/pull-refresh/success-duration.vue +0 -31
- package/demos/mobile/app/pull-refresh/success-text.vue +0 -27
- package/demos/pc/app/grid/loading/grid-loading-off-tip.spec.js +0 -8
- package/demos/pc/app/tag/before-delete.vue +0 -64
- package/demos/pc/app/tag/closable-composition-api.vue +0 -25
- package/demos/pc/app/tag/closable.spec.ts +0 -14
- /package/demos/pc/app/button/{autofocus.spec.js → autofocus.spec.ts} +0 -0
- /package/demos/pc/app/button/{basic-usage.spec.js → basic-usage.spec.ts} +0 -0
- /package/demos/pc/app/button/{click.spec.js → click.spec.ts} +0 -0
- /package/demos/pc/app/button/{icon.spec.js → icon.spec.ts} +0 -0
- /package/demos/pc/app/button/{image.spec.js → image.spec.ts} +0 -0
- /package/demos/pc/app/button/{loading.spec.js → loading.spec.ts} +0 -0
- /package/demos/pc/app/button/{reset-time.spec.js → reset-time.spec.ts} +0 -0
- /package/demos/pc/app/button/{size.spec.js → size.spec.ts} +0 -0
- /package/demos/pc/app/button/{text.spec.js → text.spec.ts} +0 -0
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import type { PropType } from 'vue'
|
|
26
26
|
import { defineComponent, computed } from 'vue'
|
|
27
27
|
import { Tag as TinyTag, Alert as TinyAlert, Tooltip as TinyTooltip } from '@opentiny/vue'
|
|
28
|
-
import {
|
|
28
|
+
import { getWord } from '../../i18n/index'
|
|
29
29
|
|
|
30
30
|
enum STAGE {
|
|
31
31
|
experimental = 'experimental',
|
|
@@ -140,9 +140,11 @@ export default defineComponent({
|
|
|
140
140
|
})
|
|
141
141
|
|
|
142
142
|
const generateDes = (desMap: typeof cnDesMap) => {
|
|
143
|
-
// 当前stable之后,不显示experimental的描述
|
|
144
|
-
const isFilterExperimental = [STAGE.removed, STAGE.deprecated, STAGE.stable].includes(
|
|
145
|
-
|
|
143
|
+
// 当前stable之后,不显示experimental的描述
|
|
144
|
+
const isFilterExperimental = [STAGE.removed, STAGE.deprecated, STAGE.stable].includes(
|
|
145
|
+
currentStageComputed.value as STAGE
|
|
146
|
+
)
|
|
147
|
+
// 当前deprecated之后,不显示stable的描述
|
|
146
148
|
const isFilterStable = [STAGE.removed, STAGE.deprecated].includes(currentStageComputed.value as STAGE)
|
|
147
149
|
|
|
148
150
|
const goingStages = Object.entries(desMap).filter(([stage]) => {
|
|
@@ -163,17 +165,21 @@ export default defineComponent({
|
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
const tipComputed = computed(() => {
|
|
166
|
-
if (props.tip) return
|
|
168
|
+
if (props.tip) return getWord(props.tip['zh-CN'], props.tip['en-US']) as string
|
|
167
169
|
|
|
168
170
|
if (!props.metaData) return ''
|
|
169
171
|
|
|
170
172
|
const vertionDesZnCn = generateDes(cnDesMap)
|
|
171
|
-
const znChTip = `该${props.tipSubject === 'component' ? '组件' : '特性'}${vertionDesZnCn}。${
|
|
173
|
+
const znChTip = `该${props.tipSubject === 'component' ? '组件' : '特性'}${vertionDesZnCn}。${
|
|
174
|
+
props.extendTip?.['zh-CN'] || ''
|
|
175
|
+
}`
|
|
172
176
|
|
|
173
177
|
const vertionDesEnUs = generateDes(enDesMap)
|
|
174
|
-
const enUsTip = `This ${props.tipSubject === 'component' ? 'component' : 'feature'} is ${vertionDesEnUs}. ${
|
|
178
|
+
const enUsTip = `This ${props.tipSubject === 'component' ? 'component' : 'feature'} is ${vertionDesEnUs}. ${
|
|
179
|
+
props.extendTip?.['en-US'] || ''
|
|
180
|
+
}`
|
|
175
181
|
|
|
176
|
-
return
|
|
182
|
+
return getWord(znChTip, enUsTip) as string
|
|
177
183
|
})
|
|
178
184
|
|
|
179
185
|
const alertTypeComputed = computed(() => {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
</version-tip>
|
|
17
17
|
<template v-if="currJson?.demos?.length > 0">
|
|
18
18
|
<div class="all-demos-container">
|
|
19
|
-
<h2 class="ti-f30 ti-fw-normal !ti-mb20">{{
|
|
19
|
+
<h2 class="ti-f30 ti-fw-normal !ti-mb20">{{ i18nByKey('yan-shi') }}</h2>
|
|
20
20
|
<div v-if="apiModeState.demoMode === 'default'" class="ti-f-c ti-f-wrap">
|
|
21
21
|
<template v-if="currJson.column === '2' && currJson.demos.length > 1">
|
|
22
22
|
<div class="one-demo-col2">
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<div id="API">
|
|
42
42
|
<h2 class="ti-f30 ti-fw-normal ti-mt28">API</h2>
|
|
43
43
|
<!-- apis 是一个数组 {name,type,properties:[原table内容],events:[] ...........} -->
|
|
44
|
-
<div class="mt20" v-for="
|
|
44
|
+
<div class="mt20" v-for="oneGroup in currJson.apis" :key="oneGroup.name">
|
|
45
45
|
<div class="ti-f-r ti-f-pos-start ti-fw-bold">
|
|
46
46
|
<div :id="oneGroup.name" class="ti-f18">{{ oneGroup.name }}</div>
|
|
47
47
|
<div class="ti-ml12 ti-b-a-primary ti-c-primary ti-px8 ti-py4">{{ oneGroup.type }}</div>
|
|
@@ -52,23 +52,23 @@
|
|
|
52
52
|
<table class="api-table">
|
|
53
53
|
<thead>
|
|
54
54
|
<tr v-if="key.includes('slots')">
|
|
55
|
-
<th width="15%">{{
|
|
56
|
-
<th width="85%">{{
|
|
55
|
+
<th width="15%">{{ i18nByKey('name') }}</th>
|
|
56
|
+
<th width="85%">{{ i18nByKey('desc') }}</th>
|
|
57
57
|
</tr>
|
|
58
58
|
<tr v-else-if="key.includes('events')">
|
|
59
|
-
<th width="15%">{{
|
|
60
|
-
<th width="20%">{{
|
|
61
|
-
<th width="65%">{{
|
|
59
|
+
<th width="15%">{{ i18nByKey('name') }}</th>
|
|
60
|
+
<th width="20%">{{ i18nByKey('propType') }}</th>
|
|
61
|
+
<th width="65%">{{ i18nByKey('desc') }}</th>
|
|
62
62
|
</tr>
|
|
63
63
|
<tr v-else>
|
|
64
|
-
<th width="15%">{{
|
|
65
|
-
<th width="20%">{{
|
|
66
|
-
<th width="20%">{{
|
|
67
|
-
<th width="45%">{{
|
|
64
|
+
<th width="15%">{{ i18nByKey('name') }}</th>
|
|
65
|
+
<th width="20%">{{ i18nByKey('propType') }}</th>
|
|
66
|
+
<th width="20%">{{ i18nByKey('defValue') }}</th>
|
|
67
|
+
<th width="45%">{{ i18nByKey('desc') }}</th>
|
|
68
68
|
</tr>
|
|
69
69
|
</thead>
|
|
70
70
|
<tbody>
|
|
71
|
-
<tr v-for="row in oneApiArr" :key="row.name">
|
|
71
|
+
<tr v-for="row in oneApiArr.sort((a, b) => a.name.localeCompare(b.name))" :key="row.name">
|
|
72
72
|
<td>
|
|
73
73
|
<a v-if="row.demoId" @click="jumpToDemo(row.demoId)">{{ row.name }}</a>
|
|
74
74
|
<span v-else>{{ row.name }}</span>
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
<h2 id="FAQ" v-if="cmpFAQMd" class="ti-f30 ti-fw-normal ti-mt28 ti-mb20">FAQ</h2>
|
|
118
118
|
<div class="markdown-body" v-html="cmpFAQMd"></div>
|
|
119
119
|
<div v-if="currJson.owner" class="ti-abs ti-right24 ti-top24" @click="copyText(currJson.owner)">
|
|
120
|
-
{{
|
|
120
|
+
{{ i18nByKey('doc-owner') }} : {{ currJson.owner }}
|
|
121
121
|
</div>
|
|
122
122
|
</div>
|
|
123
123
|
|
|
@@ -142,7 +142,7 @@ import { defineComponent, reactive, computed, toRefs, watch, onMounted, ref } fr
|
|
|
142
142
|
import { marked } from 'marked'
|
|
143
143
|
import { Loading, Anchor, ButtonGroup } from '@opentiny/vue'
|
|
144
144
|
import debounce from '@opentiny/vue-renderless/common/deps/debounce'
|
|
145
|
-
import {
|
|
145
|
+
import { i18nByKey, getWord, $clone, fetchDemosFile, useApiMode, useTemplateMode } from '@/tools'
|
|
146
146
|
import demo from '@/views/components/demo'
|
|
147
147
|
import { router } from '@/router.js'
|
|
148
148
|
import { Collapse, CollapseItem } from '@opentiny/vue'
|
|
@@ -168,7 +168,7 @@ export default defineComponent({
|
|
|
168
168
|
const anchorRefreshKey = ref(0)
|
|
169
169
|
const state = reactive({
|
|
170
170
|
webDocPath: computed(() => ''),
|
|
171
|
-
langKey:
|
|
171
|
+
langKey: getWord('zh-CN', 'en-US'),
|
|
172
172
|
cmpId: '',
|
|
173
173
|
currJson: { column: 1, demos: [], apis: [] },
|
|
174
174
|
cmpTopMd: null,
|
|
@@ -219,6 +219,7 @@ export default defineComponent({
|
|
|
219
219
|
// 用户打开官网有时候会带一些特殊字符的hash,try catch一下防止js报错
|
|
220
220
|
scrollTarget = document.querySelector(`#${hash}`)
|
|
221
221
|
} catch (err) {
|
|
222
|
+
// eslint-disable-next-line no-console
|
|
222
223
|
console.log('querySelector has special character:', err)
|
|
223
224
|
}
|
|
224
225
|
if (scrollTarget) {
|
|
@@ -263,7 +264,7 @@ export default defineComponent({
|
|
|
263
264
|
|
|
264
265
|
// saas下切换mode和组价示例都会触发loadPage,需要防抖
|
|
265
266
|
const loadPage = debounce(templateModeState.isSaas ? 100 : 0, false, () => {
|
|
266
|
-
const lang =
|
|
267
|
+
const lang = getWord('cn', 'en')
|
|
267
268
|
state.cmpId = router.currentRoute.value.params.cmpId
|
|
268
269
|
|
|
269
270
|
// 将请求合并起来,这样页面更新一次,页面刷新的时机就固定了
|
|
@@ -287,6 +288,7 @@ export default defineComponent({
|
|
|
287
288
|
}
|
|
288
289
|
|
|
289
290
|
// 3、加载cmpId.js 文件
|
|
291
|
+
// eslint-disable-next-line no-eval
|
|
290
292
|
const json = eval('(' + jsData.slice(15) + ')')
|
|
291
293
|
state.currJson = {
|
|
292
294
|
...json,
|
|
@@ -295,12 +297,14 @@ export default defineComponent({
|
|
|
295
297
|
}
|
|
296
298
|
if (state.cmpId?.startsWith('grid-')) {
|
|
297
299
|
fetchDemosFile(`${staticDemoPath}/grid/webdoc/grid.js`).then((data) => {
|
|
300
|
+
// eslint-disable-next-line no-eval
|
|
298
301
|
const gridJson = eval('(' + data.slice(15) + ')')
|
|
299
302
|
state.currJson.apis = gridJson.apis
|
|
300
303
|
state.currJson.types = gridJson.types
|
|
301
304
|
})
|
|
302
305
|
} else if (state.cmpId?.startsWith('chart-')) {
|
|
303
306
|
fetchDemosFile(`${staticDemoPath}/chart/webdoc/chart.js`).then((data) => {
|
|
307
|
+
// eslint-disable-next-line no-eval
|
|
304
308
|
const chartJson = eval('(' + data.slice(15) + ')')
|
|
305
309
|
state.currJson.apis = chartJson.apis
|
|
306
310
|
})
|
|
@@ -330,30 +334,23 @@ export default defineComponent({
|
|
|
330
334
|
copyText: (text) => {
|
|
331
335
|
navigator.clipboard.writeText(text)
|
|
332
336
|
},
|
|
337
|
+
// 点击 api区域的 name列时
|
|
333
338
|
jumpToDemo: (demoId) => {
|
|
334
339
|
if (demoId.startsWith('chart') || demoId.startsWith('grid')) {
|
|
335
340
|
router.push(demoId)
|
|
336
341
|
} else {
|
|
337
342
|
router.push(`#${demoId}`)
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
handleApiClick: (ev) => {
|
|
341
|
-
if (ev.target.tagName === 'A') {
|
|
342
|
-
ev.preventDefault()
|
|
343
|
-
const href = ev.target.getAttribute('href')
|
|
344
|
-
const hash = $split(href, '#', -1)
|
|
345
|
-
router.push(href)
|
|
346
|
-
state.singleDemo = state.currJson.demos.find((d) => d.demoId === hash)
|
|
347
343
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
state.singleDemo = state.currJson.demos.find((d) => d.demoId === demoId)
|
|
344
|
+
if (apiModeState.demoMode === 'single') {
|
|
345
|
+
state.singleDemo = state.currJson.demos.find((d) => d.demoId === demoId)
|
|
346
|
+
}
|
|
352
347
|
}
|
|
353
348
|
},
|
|
349
|
+
// 点击api 区域的type列
|
|
354
350
|
handleTypeClick: (ev) => {
|
|
355
351
|
changeActiveNames(ev.target.hash, true)
|
|
356
352
|
},
|
|
353
|
+
// 目录列表上的点击
|
|
357
354
|
handleAnchorClick: (e, data) => {
|
|
358
355
|
if (apiModeState.demoMode === 'single' && data.link.startsWith('#')) {
|
|
359
356
|
e.preventDefault()
|
|
@@ -412,7 +409,7 @@ export default defineComponent({
|
|
|
412
409
|
return {
|
|
413
410
|
...toRefs(state),
|
|
414
411
|
...fn,
|
|
415
|
-
|
|
412
|
+
i18nByKey,
|
|
416
413
|
anchorRefreshKey,
|
|
417
414
|
apiModeState,
|
|
418
415
|
templateModeState,
|
|
@@ -550,21 +547,23 @@ table.api-table {
|
|
|
550
547
|
.custom-block.tip {
|
|
551
548
|
background-color: #f3f5f7;
|
|
552
549
|
border-color: #42b983;
|
|
553
|
-
border-radius: 0;
|
|
554
|
-
padding:
|
|
555
|
-
border-left-width: 0.
|
|
550
|
+
border-radius: 0.3rem;
|
|
551
|
+
padding: 0.5rem 1rem;
|
|
552
|
+
border-left-width: 0.3rem;
|
|
556
553
|
border-left-style: solid;
|
|
557
554
|
margin: 1rem 0;
|
|
558
555
|
font-size: 14px;
|
|
559
556
|
color: #5e6d82;
|
|
560
|
-
line-height:
|
|
557
|
+
line-height: 2;
|
|
558
|
+
|
|
561
559
|
.custom-block-title {
|
|
562
560
|
font-weight: 600;
|
|
561
|
+
margin-bottom: 0.5rem;
|
|
563
562
|
}
|
|
563
|
+
|
|
564
564
|
p {
|
|
565
|
-
margin:
|
|
566
|
-
font-size:
|
|
567
|
-
line-height: 1.5;
|
|
565
|
+
margin: 0;
|
|
566
|
+
font-size: 14px;
|
|
568
567
|
}
|
|
569
568
|
ul {
|
|
570
569
|
li {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<tiny-tooltip
|
|
17
17
|
placement="top"
|
|
18
18
|
:append-to-body="false"
|
|
19
|
-
:content="demo.isOpen ?
|
|
19
|
+
:content="demo.isOpen ? i18nByKey('hideCode') : i18nByKey('showCode')"
|
|
20
20
|
>
|
|
21
21
|
<i
|
|
22
22
|
:class="!!demo.isOpen ? 'i-ti-codeslash' : 'i-ti-code'"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
@click="toggleDemoCode(demo)"
|
|
25
25
|
/>
|
|
26
26
|
</tiny-tooltip>
|
|
27
|
-
<tiny-tooltip placement="top" :append-to-body="false" :content="
|
|
27
|
+
<tiny-tooltip placement="top" :append-to-body="false" :content="i18nByKey('playground')">
|
|
28
28
|
<i class="i-ti-playground ml8 h:c-success ti-w16 ti-h16 ti-cur-hand" @click="openPlayground(demo)" />
|
|
29
29
|
</tiny-tooltip>
|
|
30
30
|
</div>
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
|
|
66
66
|
<script lang="jsx">
|
|
67
67
|
import { defineComponent, reactive, computed, toRefs, shallowRef, onMounted, watch, nextTick, inject } from 'vue'
|
|
68
|
-
import {
|
|
69
|
-
import { $split, appData, fetchDemosFile
|
|
68
|
+
import { i18nByKey, getWord } from '@/i18n'
|
|
69
|
+
import { $split, appData, fetchDemosFile } from '@/tools'
|
|
70
70
|
import { Tooltip as TinyTooltip, Tabs as TinyTabs, TabItem as TinyTabItem, Button as TinyButton } from '@opentiny/vue'
|
|
71
71
|
import { languageMap, vueComponents, getWebdocPath, staticDemoPath } from './cmpConfig'
|
|
72
72
|
import { router } from '@/router.js'
|
|
@@ -108,7 +108,7 @@ export default defineComponent({
|
|
|
108
108
|
.then((code) => {
|
|
109
109
|
return code
|
|
110
110
|
})
|
|
111
|
-
.catch((
|
|
111
|
+
.catch(() => {
|
|
112
112
|
return `${demoName}示例资源不存在,请检查文件名是否正确?`
|
|
113
113
|
})
|
|
114
114
|
const ext = $split(fileName, '.', -1)
|
|
@@ -123,7 +123,7 @@ export default defineComponent({
|
|
|
123
123
|
const state = reactive({
|
|
124
124
|
tabValue: 'tab0',
|
|
125
125
|
cmpId: router.currentRoute.value.params.cmpId,
|
|
126
|
-
langKey:
|
|
126
|
+
langKey: getWord('zh-CN', 'en-US'),
|
|
127
127
|
currDemoId: computed(() => {
|
|
128
128
|
let hash = router.currentRoute.value.hash?.slice(1)
|
|
129
129
|
|
|
@@ -133,7 +133,7 @@ export default defineComponent({
|
|
|
133
133
|
}
|
|
134
134
|
return hash
|
|
135
135
|
}),
|
|
136
|
-
copyTip:
|
|
136
|
+
copyTip: i18nByKey('copyCode'),
|
|
137
137
|
copyIcon: 'i-ti-copy'
|
|
138
138
|
})
|
|
139
139
|
|
|
@@ -169,12 +169,12 @@ export default defineComponent({
|
|
|
169
169
|
|
|
170
170
|
navigator.clipboard.writeText(demo.files[0].code)
|
|
171
171
|
}
|
|
172
|
-
state.copyTip =
|
|
172
|
+
state.copyTip = i18nByKey('copyCodeOk')
|
|
173
173
|
state.copyIcon = 'i-ti-check'
|
|
174
174
|
},
|
|
175
175
|
resetTip() {
|
|
176
176
|
setTimeout(() => {
|
|
177
|
-
state.copyTip =
|
|
177
|
+
state.copyTip = i18nByKey('copyCode')
|
|
178
178
|
state.copyIcon = 'i-ti-copy'
|
|
179
179
|
}, 300)
|
|
180
180
|
},
|
|
@@ -218,7 +218,7 @@ export default defineComponent({
|
|
|
218
218
|
}
|
|
219
219
|
)
|
|
220
220
|
|
|
221
|
-
return { ...toRefs(state), ...fn, appData, vueComponents, demoConfig, cmp, isMobileFirst }
|
|
221
|
+
return { ...toRefs(state), ...fn, appData, vueComponents, demoConfig, cmp, isMobileFirst, i18nByKey }
|
|
222
222
|
}
|
|
223
223
|
})
|
|
224
224
|
</script>
|
|
@@ -304,7 +304,7 @@ export default defineComponent({
|
|
|
304
304
|
position: absolute;
|
|
305
305
|
left: 11px;
|
|
306
306
|
top: 79px;
|
|
307
|
-
transform:
|
|
307
|
+
transform: i18nByKeyX(0);
|
|
308
308
|
overflow: hidden;
|
|
309
309
|
}
|
|
310
310
|
}
|
package/src/views/docs/docs.vue
CHANGED
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
<script setup>
|
|
15
15
|
import { ref, nextTick, watch, onMounted, computed, shallowRef } from 'vue'
|
|
16
|
-
import {
|
|
17
|
-
import { $t2 } from '@/tools'
|
|
16
|
+
import { getWord } from '@/tools'
|
|
18
17
|
import docMDs, { transformIdSelector } from './docConfig.js'
|
|
19
18
|
import { router } from '@/router.js'
|
|
20
19
|
|
|
@@ -28,7 +27,7 @@ const catalog = ref([])
|
|
|
28
27
|
const docCmp = shallowRef(null)
|
|
29
28
|
|
|
30
29
|
async function loadPage() {
|
|
31
|
-
let suffix =
|
|
30
|
+
let suffix = getWord('', '-en')
|
|
32
31
|
const docKey = router.currentRoute.value.params.docId
|
|
33
32
|
const docName = isOpen && openDocMap[docKey] ? openDocMap[docKey] : docKey
|
|
34
33
|
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
<div class="main-layout ti-hp100 ti-f-c ti-f-box-stretch">
|
|
3
3
|
<!-- 切换语言 -->
|
|
4
4
|
<div class="lang-box">
|
|
5
|
-
<tiny-tooltip :content="
|
|
6
|
-
<span class="lang-btn" @click="changeLanguage">{{
|
|
5
|
+
<tiny-tooltip :content="i18nByKey('changeLanguage')" placement="left">
|
|
6
|
+
<span class="lang-btn" @click="changeLanguage">{{ i18nByKey('language') }}</span>
|
|
7
7
|
</tiny-tooltip>
|
|
8
8
|
</div>
|
|
9
9
|
<!-- 切換主题样式 -->
|
|
10
10
|
<tiny-dropdown v-if="!templateModeState.isSaas" class="theme-change-button" trigger="click">
|
|
11
|
-
<tiny-tooltip :content="
|
|
11
|
+
<tiny-tooltip :content="i18nByKey('changeTheme')" placement="left">
|
|
12
12
|
<span>
|
|
13
|
-
<img :src="themeSvg" :alt="
|
|
13
|
+
<img :src="themeSvg" :alt="i18nByKey('changeTheme')" />
|
|
14
14
|
</span>
|
|
15
15
|
</tiny-tooltip>
|
|
16
16
|
<template #dropdown>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<div v-show="!isCollapsed" class="api-type-box" :class="{ 'is-collapsed': isCollapsed }">
|
|
32
32
|
<div class="api-type">
|
|
33
33
|
<div :class="{ 'api-mode': true, active: apiModeState.apiMode === 'Options' }">
|
|
34
|
-
{{
|
|
34
|
+
{{ getWord('选项式', 'Options') }}
|
|
35
35
|
</div>
|
|
36
36
|
<tiny-switch
|
|
37
37
|
class="api-switch"
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
v-model="apiModeState.apiMode"
|
|
42
42
|
></tiny-switch>
|
|
43
43
|
<div :class="{ 'api-mode': true, active: apiModeState.apiMode === 'Composition' }">
|
|
44
|
-
{{
|
|
44
|
+
{{ getWord('组合式', 'Composition') }}
|
|
45
45
|
</div>
|
|
46
|
-
<tiny-tooltip :content="
|
|
46
|
+
<tiny-tooltip :content="i18nByKey('apiType')" placement="right">
|
|
47
47
|
<icon-help-circle></icon-help-circle>
|
|
48
48
|
</tiny-tooltip>
|
|
49
49
|
</div>
|
|
50
50
|
|
|
51
51
|
<div class="api-type">
|
|
52
52
|
<div :class="{ 'api-mode': true, active: apiModeState.demoMode === 'single' }">
|
|
53
|
-
{{
|
|
53
|
+
{{ getWord('单示例', 'Single') }}
|
|
54
54
|
</div>
|
|
55
55
|
<tiny-switch
|
|
56
56
|
class="api-switch"
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
v-model="apiModeState.demoMode"
|
|
61
61
|
></tiny-switch>
|
|
62
62
|
<div :class="{ 'api-mode': true, active: apiModeState.demoMode === 'default' }">
|
|
63
|
-
{{
|
|
63
|
+
{{ getWord('多示例', 'Multiple') }}
|
|
64
64
|
</div>
|
|
65
|
-
<tiny-tooltip :content="
|
|
65
|
+
<tiny-tooltip :content="getWord('切换demo的预览模式', 'Change demo preview mode')" placement="right">
|
|
66
66
|
<icon-help-circle></icon-help-circle>
|
|
67
67
|
</tiny-tooltip>
|
|
68
68
|
</div>
|
|
@@ -83,12 +83,8 @@
|
|
|
83
83
|
<div class="node-name-container">
|
|
84
84
|
<tiny-tag v-if="data?.mode?.includes('mobile-first')" effect="plain">多端</tiny-tag>
|
|
85
85
|
<span class="node-name-label">{{ data.label }}</span>
|
|
86
|
-
<tiny-tag
|
|
87
|
-
|
|
88
|
-
class="node-float-tip"
|
|
89
|
-
effect="dark"
|
|
90
|
-
:type="data.mark?.type">
|
|
91
|
-
{{ data.mark.text}}
|
|
86
|
+
<tiny-tag v-if="data.mark?.text" class="node-float-tip" effect="dark" :type="data.mark?.type">
|
|
87
|
+
{{ data.mark.text }}
|
|
92
88
|
</tiny-tag>
|
|
93
89
|
</div>
|
|
94
90
|
</template>
|
|
@@ -113,7 +109,7 @@ import { Switch, TreeMenu, Dropdown, DropdownMenu, DropdownItem, Tooltip, Tag }
|
|
|
113
109
|
import { iconHelpCircle } from '@opentiny/vue-icon'
|
|
114
110
|
import { genMenus } from '@/menus.jsx'
|
|
115
111
|
import { router } from '@/router.js'
|
|
116
|
-
import {
|
|
112
|
+
import { getWord, i18nByKey, appData, appFn, useApiMode, useTemplateMode } from '@/tools'
|
|
117
113
|
import themeSvg from '@/assets/images/theme.svg?url'
|
|
118
114
|
import useTheme from '@/tools/useTheme'
|
|
119
115
|
|
|
@@ -144,7 +140,7 @@ export default defineComponent({
|
|
|
144
140
|
expandKeys: []
|
|
145
141
|
})
|
|
146
142
|
|
|
147
|
-
const lang =
|
|
143
|
+
const lang = getWord('zh-CN', 'en-US')
|
|
148
144
|
const getTo = (route, key) => `${import.meta.env.VITE_CONTEXT}${lang}/os-theme/${route}${key}`
|
|
149
145
|
|
|
150
146
|
const changeLanguage = () => {
|
|
@@ -217,7 +213,9 @@ export default defineComponent({
|
|
|
217
213
|
changeLanguage,
|
|
218
214
|
apiModeState,
|
|
219
215
|
apiModeFn,
|
|
220
|
-
templateModeState
|
|
216
|
+
templateModeState,
|
|
217
|
+
getWord,
|
|
218
|
+
i18nByKey
|
|
221
219
|
}
|
|
222
220
|
}
|
|
223
221
|
})
|
package/src/views/overview.vue
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<div class="overview-layout ti-pt48">
|
|
4
4
|
<h1 class="ti-mb20 ti-f24 ti-fw-600">
|
|
5
|
-
{{
|
|
5
|
+
{{ i18nByKey('overview') }}
|
|
6
6
|
<span class="ti-f18">({{ getTotalComponentsNum() }})</span>
|
|
7
7
|
</h1>
|
|
8
8
|
|
|
9
9
|
<h1 class="ti-f14 ti-my20 ti-lh21">
|
|
10
|
-
{{
|
|
10
|
+
{{ i18nByKey('overviewDesc') }}
|
|
11
11
|
</h1>
|
|
12
12
|
<!-- 搜索 -->
|
|
13
13
|
<tiny-input
|
|
14
|
-
:placeholder="
|
|
14
|
+
:placeholder="i18nByKey('searchComponents')"
|
|
15
15
|
v-model="value"
|
|
16
16
|
class="ti-mb10 search-input"
|
|
17
17
|
:style="{ width: '100%', padding: '6px' }"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
<div v-for="(menu, index) in searchMenus" :label="menu" :key="index">
|
|
29
29
|
<div class="ti-rel ti-mt25">
|
|
30
|
-
<h2 class="ti-f16 ti-d-ib ti-fw-600 ti-mr8">{{
|
|
30
|
+
<h2 class="ti-f16 ti-d-ib ti-fw-600 ti-mr8">{{ getWord(menu.label, menu.labelEn) }}</h2>
|
|
31
31
|
<span v-if="searchMenus?.length !== 0" class="cell-title">{{ menu.children.length }}</span>
|
|
32
32
|
</div>
|
|
33
33
|
<div class="ti-f-r ti-f-wrap ti-f-pos-between overview-card">
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
<div class="ti-br-4 component-card">
|
|
42
42
|
<img
|
|
43
43
|
class="ti-h125 ti-w125"
|
|
44
|
-
:src="
|
|
45
|
-
:onerror="`this.src='${
|
|
44
|
+
:src="pubUrl(`@demos/overviewimage/${getSvg(cell.key)}.svg`)"
|
|
45
|
+
:onerror="`this.src='${pubUrl(`@demos/overviewimage/dev.svg`)}'`"
|
|
46
46
|
/>
|
|
47
47
|
<h2 class="ti-f16 overview-card-label">
|
|
48
48
|
{{ cell.name }}
|
|
@@ -66,8 +66,7 @@ import { cmpMenus } from '@menu/menus.js'
|
|
|
66
66
|
import TinyInput from '@opentiny/vue-input'
|
|
67
67
|
import noDataSvg from '@/assets/images/no-data.svg?url'
|
|
68
68
|
import searchSvg from '@/assets/images/search.svg?url'
|
|
69
|
-
import {
|
|
70
|
-
|
|
69
|
+
import { getWord, i18nByKey, isZhCn, pubUrl } from '@/tools'
|
|
71
70
|
|
|
72
71
|
export default defineComponent({
|
|
73
72
|
name: 'Overview',
|
|
@@ -98,7 +97,7 @@ export default defineComponent({
|
|
|
98
97
|
const trimValue = value.replaceAll(' ', '').toLowerCase()
|
|
99
98
|
const currentValue = trimValue
|
|
100
99
|
const reg = new RegExp(currentValue, 'ig')
|
|
101
|
-
const isGrid =
|
|
100
|
+
const isGrid = trimValue === 'grid' || trimValue === '表格'
|
|
102
101
|
const searchMenus = state.menus
|
|
103
102
|
.map((item) => {
|
|
104
103
|
const label = item.label
|
|
@@ -115,7 +114,7 @@ export default defineComponent({
|
|
|
115
114
|
.filter((item) => item.children.length > 0)
|
|
116
115
|
state.searchMenus = searchMenus
|
|
117
116
|
}
|
|
118
|
-
const lang =
|
|
117
|
+
const lang = getWord('zh-CN', 'en-US')
|
|
119
118
|
let fn = {
|
|
120
119
|
searchHandler: debounce(searchResultFn, 300),
|
|
121
120
|
getTo: (key) => `${import.meta.env.VITE_CONTEXT}${lang}/os-theme/components/${key}`,
|
|
@@ -128,7 +127,7 @@ export default defineComponent({
|
|
|
128
127
|
}
|
|
129
128
|
},
|
|
130
129
|
getTotalComponentsNum: () => {
|
|
131
|
-
let total = 0
|
|
130
|
+
let total = 0
|
|
132
131
|
cmpMenus.forEach((cmpCategory) => {
|
|
133
132
|
if (cmpCategory.key === 'cmp_frame_style') {
|
|
134
133
|
total += 2
|
|
@@ -145,7 +144,7 @@ export default defineComponent({
|
|
|
145
144
|
const common = new window.TDCommon(['#footer'], {})
|
|
146
145
|
common.renderFooter()
|
|
147
146
|
})
|
|
148
|
-
return { ...toRefs(state), ...fn, TinyInput, noDataSvg, searchSvg, isZhCn }
|
|
147
|
+
return { ...toRefs(state), ...fn, TinyInput, noDataSvg, searchSvg, isZhCn, getWord, i18nByKey, pubUrl }
|
|
149
148
|
}
|
|
150
149
|
})
|
|
151
150
|
</script>
|
|
@@ -174,7 +173,11 @@ export default defineComponent({
|
|
|
174
173
|
|
|
175
174
|
.component-card {
|
|
176
175
|
box-shadow: 1px 1px 4px 1px rgba(31, 52, 121, 0.1);
|
|
177
|
-
transition:
|
|
176
|
+
transition:
|
|
177
|
+
color 0.3s,
|
|
178
|
+
background-color 0.3s,
|
|
179
|
+
box-shadow 0.3s,
|
|
180
|
+
border-color 0.3s;
|
|
178
181
|
padding: 24px;
|
|
179
182
|
font-size: 14px;
|
|
180
183
|
color: rgb(51, 54, 57);
|
package/vite.config.ts
CHANGED
|
@@ -12,6 +12,7 @@ import importPlugin from '@opentiny/vue-vite-import'
|
|
|
12
12
|
import vue3SvgPlugin from 'vite-svg-loader'
|
|
13
13
|
import { getAlias, pathFromWorkspaceRoot, getOptimizeDeps } from '../../internals/cli/src/config/vite'
|
|
14
14
|
import virtualTemplatePlugin from '@opentiny-internal/unplugin-virtual-template/vite'
|
|
15
|
+
import tailwindCss from 'tailwindcss'
|
|
15
16
|
|
|
16
17
|
export default defineConfig((config) => {
|
|
17
18
|
const env = loadEnv(config.mode, process.cwd() + '/env', '')
|
|
@@ -97,13 +98,20 @@ export default defineConfig((config) => {
|
|
|
97
98
|
strict: false,
|
|
98
99
|
allow: ['..']
|
|
99
100
|
}
|
|
101
|
+
},
|
|
102
|
+
define: {
|
|
103
|
+
__VUE_I18N_FULL_INSTALL__: true,
|
|
104
|
+
__VUE_I18N_LEGACY_API__: true,
|
|
105
|
+
__INTLIFY_PROD_DEVTOOLS__: false,
|
|
106
|
+
__INTLIFY_JIT_COMPILATION__: false,
|
|
107
|
+
__INTLIFY_DROP_MESSAGE_COMPILER__: false
|
|
100
108
|
}
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
if (env.VITE_TINY_THEME === 'saas') {
|
|
104
112
|
viteConfig.css = {
|
|
105
113
|
postcss: {
|
|
106
|
-
plugins: [
|
|
114
|
+
plugins: [tailwindCss]
|
|
107
115
|
}
|
|
108
116
|
}
|
|
109
117
|
// 这里逻辑是兼容saas官网工程的alias写法
|
|
@@ -114,9 +122,7 @@ export default defineConfig((config) => {
|
|
|
114
122
|
}
|
|
115
123
|
|
|
116
124
|
if (env.NODE_ENV === 'development') {
|
|
117
|
-
viteConfig.define = {
|
|
118
|
-
'process.env': {}
|
|
119
|
-
}
|
|
125
|
+
viteConfig.define['process.env'] = {}
|
|
120
126
|
}
|
|
121
127
|
|
|
122
128
|
return viteConfig
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div class="page__hd">
|
|
4
|
-
<h1 class="page__title">Refresh</h1>
|
|
5
|
-
<p class="page__desc">下拉刷新</p>
|
|
6
|
-
</div>
|
|
7
|
-
<tiny-pull-refresh
|
|
8
|
-
v-model="isLoading"
|
|
9
|
-
@refresh="onRefresh"
|
|
10
|
-
success-text="刷新成功"
|
|
11
|
-
animation-duration="500"
|
|
12
|
-
success-duration="2000"
|
|
13
|
-
:disabled="false"
|
|
14
|
-
>
|
|
15
|
-
<h3>hello pull-refresh</h3>
|
|
16
|
-
</tiny-pull-refresh>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script lang="jsx">
|
|
21
|
-
import { PullRefresh } from '@opentiny/vue'
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
components: {
|
|
25
|
-
TinyPullRefresh: PullRefresh
|
|
26
|
-
},
|
|
27
|
-
data() {
|
|
28
|
-
return {
|
|
29
|
-
isLoading: false
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
onRefresh() {
|
|
34
|
-
setTimeout(() => {
|
|
35
|
-
this.isLoading = false
|
|
36
|
-
}, 1000)
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<style scoped>
|
|
43
|
-
.page__hd {
|
|
44
|
-
padding: 40px;
|
|
45
|
-
}
|
|
46
|
-
.page__title {
|
|
47
|
-
font-weight: 400;
|
|
48
|
-
font-size: 21px;
|
|
49
|
-
text-align: left;
|
|
50
|
-
}
|
|
51
|
-
.page__desc {
|
|
52
|
-
margin-top: 5px;
|
|
53
|
-
color: #888;
|
|
54
|
-
font-size: 14px;
|
|
55
|
-
text-align: left;
|
|
56
|
-
}
|
|
57
|
-
</style>
|