stellar-ui-plus 1.16.18
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/README.md +176 -0
- package/common/css/common.scss +19 -0
- package/common/useProps.js +9 -0
- package/components/ste-animate/ATTRIBUTES.md +10 -0
- package/components/ste-animate/README.md +115 -0
- package/components/ste-animate/animate.scss +247 -0
- package/components/ste-animate/config.json +5 -0
- package/components/ste-animate/props.ts +9 -0
- package/components/ste-animate/ste-animate.easycom.json +39 -0
- package/components/ste-animate/ste-animate.scss +113 -0
- package/components/ste-animate/ste-animate.vue +67 -0
- package/components/ste-badge/ATTRIBUTES.md +17 -0
- package/components/ste-badge/README.md +162 -0
- package/components/ste-badge/config.json +5 -0
- package/components/ste-badge/props.ts +17 -0
- package/components/ste-badge/ste-badge.easycom.json +96 -0
- package/components/ste-badge/ste-badge.vue +157 -0
- package/components/ste-barcode/ATTRIBUTES.md +14 -0
- package/components/ste-barcode/README.md +28 -0
- package/components/ste-barcode/config.json +5 -0
- package/components/ste-barcode/encode.ts +317 -0
- package/components/ste-barcode/props.ts +7 -0
- package/components/ste-barcode/ste-barcode.easycom.json +44 -0
- package/components/ste-barcode/ste-barcode.vue +152 -0
- package/components/ste-button/ATTRIBUTES.md +32 -0
- package/components/ste-button/README.md +119 -0
- package/components/ste-button/config.json +5 -0
- package/components/ste-button/props.ts +21 -0
- package/components/ste-button/ste-button.easycom.json +168 -0
- package/components/ste-button/ste-button.vue +275 -0
- package/components/ste-calendar/ATTRIBUTES.md +31 -0
- package/components/ste-calendar/README.md +241 -0
- package/components/ste-calendar/config.json +5 -0
- package/components/ste-calendar/date.ts +110 -0
- package/components/ste-calendar/props.ts +26 -0
- package/components/ste-calendar/ste-calendar.easycom.json +172 -0
- package/components/ste-calendar/ste-calendar.vue +376 -0
- package/components/ste-calendar/useData.ts +30 -0
- package/components/ste-checkbox/ATTRIBUTES.md +25 -0
- package/components/ste-checkbox/README.md +302 -0
- package/components/ste-checkbox/config.json +5 -0
- package/components/ste-checkbox/props.ts +33 -0
- package/components/ste-checkbox/ste-checkbox.easycom.json +151 -0
- package/components/ste-checkbox/ste-checkbox.vue +206 -0
- package/components/ste-checkbox/type.d.ts +2 -0
- package/components/ste-checkbox-group/props.ts +34 -0
- package/components/ste-checkbox-group/ste-checkbox-group.vue +34 -0
- package/components/ste-code-input/ATTRIBUTES.md +22 -0
- package/components/ste-code-input/README.md +56 -0
- package/components/ste-code-input/config.json +5 -0
- package/components/ste-code-input/props.ts +19 -0
- package/components/ste-code-input/ste-code-input.easycom.json +99 -0
- package/components/ste-code-input/ste-code-input.vue +222 -0
- package/components/ste-date-picker/ATTRIBUTES.md +25 -0
- package/components/ste-date-picker/README.md +119 -0
- package/components/ste-date-picker/config.json +5 -0
- package/components/ste-date-picker/props.ts +62 -0
- package/components/ste-date-picker/ste-date-picker.easycom.json +137 -0
- package/components/ste-date-picker/ste-date-picker.vue +290 -0
- package/components/ste-date-picker/types.d.ts +3 -0
- package/components/ste-drag/ATTRIBUTES.md +13 -0
- package/components/ste-drag/README.md +88 -0
- package/components/ste-drag/config.json +5 -0
- package/components/ste-drag/props.ts +10 -0
- package/components/ste-drag/ste-drag.easycom.json +50 -0
- package/components/ste-drag/ste-drag.vue +172 -0
- package/components/ste-dropdown-menu/ATTRIBUTES.md +22 -0
- package/components/ste-dropdown-menu/README.md +325 -0
- package/components/ste-dropdown-menu/config.json +5 -0
- package/components/ste-dropdown-menu/constans.ts +4 -0
- package/components/ste-dropdown-menu/props.ts +30 -0
- package/components/ste-dropdown-menu/ste-dropdown-menu.easycom.json +111 -0
- package/components/ste-dropdown-menu/ste-dropdown-menu.scss +99 -0
- package/components/ste-dropdown-menu/ste-dropdown-menu.vue +223 -0
- package/components/ste-dropdown-menu-item/props.ts +17 -0
- package/components/ste-dropdown-menu-item/ste-dropdown-menu-item.scss +61 -0
- package/components/ste-dropdown-menu-item/ste-dropdown-menu-item.vue +84 -0
- package/components/ste-dropdown-menu-item/type.d.ts +4 -0
- package/components/ste-icon/ATTRIBUTES.md +19 -0
- package/components/ste-icon/README.md +72 -0
- package/components/ste-icon/config.json +5 -0
- package/components/ste-icon/iconfont.css +22 -0
- package/components/ste-icon/props.ts +14 -0
- package/components/ste-icon/ste-icon.easycom.json +71 -0
- package/components/ste-icon/ste-icon.vue +80 -0
- package/components/ste-image/ATTRIBUTES.md +21 -0
- package/components/ste-image/README.md +118 -0
- package/components/ste-image/config.json +5 -0
- package/components/ste-image/props.ts +15 -0
- package/components/ste-image/ste-image.easycom.json +189 -0
- package/components/ste-image/ste-image.vue +146 -0
- package/components/ste-index-item/props.ts +4 -0
- package/components/ste-index-item/ste-index-item.vue +83 -0
- package/components/ste-index-list/ATTRIBUTES.md +15 -0
- package/components/ste-index-list/README.md +138 -0
- package/components/ste-index-list/config.json +5 -0
- package/components/ste-index-list/props.ts +17 -0
- package/components/ste-index-list/ste-index-list.easycom.json +48 -0
- package/components/ste-index-list/ste-index-list.vue +109 -0
- package/components/ste-input/ATTRIBUTES.md +37 -0
- package/components/ste-input/README.md +130 -0
- package/components/ste-input/config.json +5 -0
- package/components/ste-input/props.ts +46 -0
- package/components/ste-input/ste-input.easycom.json +282 -0
- package/components/ste-input/ste-input.scss +124 -0
- package/components/ste-input/ste-input.vue +221 -0
- package/components/ste-loading/ATTRIBUTES.md +11 -0
- package/components/ste-loading/README.md +74 -0
- package/components/ste-loading/config.json +5 -0
- package/components/ste-loading/props.ts +8 -0
- package/components/ste-loading/ste-loading.easycom.json +54 -0
- package/components/ste-loading/ste-loading.vue +127 -0
- package/components/ste-media-preview/ATTRIBUTES.md +20 -0
- package/components/ste-media-preview/README.md +252 -0
- package/components/ste-media-preview/TouchScaleing.ts +117 -0
- package/components/ste-media-preview/config.json +5 -0
- package/components/ste-media-preview/props.ts +12 -0
- package/components/ste-media-preview/ste-media-preview.easycom.json +88 -0
- package/components/ste-media-preview/ste-media-preview.vue +201 -0
- package/components/ste-media-preview/useData.ts +63 -0
- package/components/ste-message-box/ATTRIBUTES.md +6 -0
- package/components/ste-message-box/README.md +222 -0
- package/components/ste-message-box/config.json +5 -0
- package/components/ste-message-box/constants.ts +25 -0
- package/components/ste-message-box/ste-message-box.easycom.json +14 -0
- package/components/ste-message-box/ste-message-box.ts +1 -0
- package/components/ste-message-box/ste-message-box.vue +355 -0
- package/components/ste-message-box/use-message-box.ts +26 -0
- package/components/ste-message-box/useData.ts +56 -0
- package/components/ste-notice-bar/ATTRIBUTES.md +22 -0
- package/components/ste-notice-bar/README.md +124 -0
- package/components/ste-notice-bar/config.json +5 -0
- package/components/ste-notice-bar/props.ts +15 -0
- package/components/ste-notice-bar/ste-notice-bar.easycom.json +109 -0
- package/components/ste-notice-bar/ste-notice-bar.vue +262 -0
- package/components/ste-number-keyboard/ATTRIBUTES.md +31 -0
- package/components/ste-number-keyboard/KeyboardVue.vue +142 -0
- package/components/ste-number-keyboard/README.md +192 -0
- package/components/ste-number-keyboard/config.json +5 -0
- package/components/ste-number-keyboard/props.ts +35 -0
- package/components/ste-number-keyboard/ste-number-keyboard.easycom.json +177 -0
- package/components/ste-number-keyboard/ste-number-keyboard.vue +81 -0
- package/components/ste-number-keyboard/useData.ts +144 -0
- package/components/ste-picker/props.ts +16 -0
- package/components/ste-picker/ste-picker.vue +194 -0
- package/components/ste-popup/ATTRIBUTES.md +24 -0
- package/components/ste-popup/README.md +135 -0
- package/components/ste-popup/config.json +6 -0
- package/components/ste-popup/event.ts +0 -0
- package/components/ste-popup/props.ts +19 -0
- package/components/ste-popup/ste-popup.easycom.json +122 -0
- package/components/ste-popup/ste-popup.vue +253 -0
- package/components/ste-price/ATTRIBUTES.md +26 -0
- package/components/ste-price/README.md +110 -0
- package/components/ste-price/config.json +5 -0
- package/components/ste-price/props.ts +23 -0
- package/components/ste-price/ste-price.easycom.json +154 -0
- package/components/ste-price/ste-price.vue +148 -0
- package/components/ste-progress/ATTRIBUTES.md +17 -0
- package/components/ste-progress/README.md +88 -0
- package/components/ste-progress/config.json +5 -0
- package/components/ste-progress/props.ts +16 -0
- package/components/ste-progress/ste-progress.easycom.json +80 -0
- package/components/ste-progress/ste-progress.vue +135 -0
- package/components/ste-qrcode/ATTRIBUTES.md +16 -0
- package/components/ste-qrcode/README.md +34 -0
- package/components/ste-qrcode/config.json +5 -0
- package/components/ste-qrcode/props.ts +16 -0
- package/components/ste-qrcode/ste-qrcode.easycom.json +56 -0
- package/components/ste-qrcode/ste-qrcode.vue +134 -0
- package/components/ste-qrcode/uqrcode.d.ts +57 -0
- package/components/ste-qrcode/uqrcode.js +34 -0
- package/components/ste-radio/ATTRIBUTES.md +25 -0
- package/components/ste-radio/README.md +260 -0
- package/components/ste-radio/config.json +5 -0
- package/components/ste-radio/props.ts +33 -0
- package/components/ste-radio/ste-radio.easycom.json +150 -0
- package/components/ste-radio/ste-radio.vue +188 -0
- package/components/ste-radio/type.d.ts +2 -0
- package/components/ste-radio-group/props.ts +33 -0
- package/components/ste-radio-group/ste-radio-group.vue +34 -0
- package/components/ste-rate/ATTRIBUTES.md +21 -0
- package/components/ste-rate/README.md +97 -0
- package/components/ste-rate/config.json +5 -0
- package/components/ste-rate/props.ts +16 -0
- package/components/ste-rate/ste-rate.easycom.json +85 -0
- package/components/ste-rate/ste-rate.vue +143 -0
- package/components/ste-read-more/ATTRIBUTES.md +16 -0
- package/components/ste-read-more/README.md +93 -0
- package/components/ste-read-more/config.json +5 -0
- package/components/ste-read-more/props.ts +9 -0
- package/components/ste-read-more/ste-read-more.easycom.json +54 -0
- package/components/ste-read-more/ste-read-more.vue +106 -0
- package/components/ste-rich-text/ATTRIBUTES.md +8 -0
- package/components/ste-rich-text/README.md +26 -0
- package/components/ste-rich-text/config.json +5 -0
- package/components/ste-rich-text/props.ts +8 -0
- package/components/ste-rich-text/ste-rich-text.easycom.json +40 -0
- package/components/ste-rich-text/ste-rich-text.vue +33 -0
- package/components/ste-scroll-to/ATTRIBUTES.md +11 -0
- package/components/ste-scroll-to/README.md +47 -0
- package/components/ste-scroll-to/config.json +5 -0
- package/components/ste-scroll-to/props.ts +17 -0
- package/components/ste-scroll-to/ste-scroll-to.easycom.json +25 -0
- package/components/ste-scroll-to/ste-scroll-to.vue +42 -0
- package/components/ste-scroll-to/useData.ts +214 -0
- package/components/ste-scroll-to-item/ste-scroll-to-item.vue +24 -0
- package/components/ste-search/ATTRIBUTES.md +39 -0
- package/components/ste-search/README.md +232 -0
- package/components/ste-search/config.json +5 -0
- package/components/ste-search/props.ts +124 -0
- package/components/ste-search/ste-search.easycom.json +232 -0
- package/components/ste-search/ste-search.vue +379 -0
- package/components/ste-search/useData.ts +34 -0
- package/components/ste-select/ATTRIBUTES.md +39 -0
- package/components/ste-select/README.md +324 -0
- package/components/ste-select/config.json +5 -0
- package/components/ste-select/datapager.vue +54 -0
- package/components/ste-select/datetime.vue +109 -0
- package/components/ste-select/defaultDate.ts +138 -0
- package/components/ste-select/props.ts +67 -0
- package/components/ste-select/ste-select.easycom.json +287 -0
- package/components/ste-select/ste-select.vue +437 -0
- package/components/ste-select/useData.ts +471 -0
- package/components/ste-signature/ATTRIBUTES.md +18 -0
- package/components/ste-signature/README.md +97 -0
- package/components/ste-signature/config.json +5 -0
- package/components/ste-signature/props.ts +12 -0
- package/components/ste-signature/ste-signature.easycom.json +74 -0
- package/components/ste-signature/ste-signature.vue +183 -0
- package/components/ste-signature/types.d.ts +4 -0
- package/components/ste-slider/ATTRIBUTES.md +25 -0
- package/components/ste-slider/README.md +149 -0
- package/components/ste-slider/config.json +5 -0
- package/components/ste-slider/props.ts +32 -0
- package/components/ste-slider/ste-slider.easycom.json +128 -0
- package/components/ste-slider/ste-slider.scss +150 -0
- package/components/ste-slider/ste-slider.vue +293 -0
- package/components/ste-slider/type.d.ts +4 -0
- package/components/ste-slider/useData.ts +79 -0
- package/components/ste-step/props.ts +10 -0
- package/components/ste-step/ste-step.scss +104 -0
- package/components/ste-step/ste-step.vue +122 -0
- package/components/ste-stepper/ATTRIBUTES.md +33 -0
- package/components/ste-stepper/README.md +172 -0
- package/components/ste-stepper/config.json +5 -0
- package/components/ste-stepper/props.ts +41 -0
- package/components/ste-stepper/ste-stepper.easycom.json +220 -0
- package/components/ste-stepper/ste-stepper.vue +249 -0
- package/components/ste-steps/ATTRIBUTES.md +12 -0
- package/components/ste-steps/README.md +139 -0
- package/components/ste-steps/config.json +5 -0
- package/components/ste-steps/props.ts +18 -0
- package/components/ste-steps/ste-steps.easycom.json +46 -0
- package/components/ste-steps/ste-steps.vue +44 -0
- package/components/ste-sticky/ATTRIBUTES.md +15 -0
- package/components/ste-sticky/README.md +56 -0
- package/components/ste-sticky/config.json +5 -0
- package/components/ste-sticky/props.ts +7 -0
- package/components/ste-sticky/ste-sticky.easycom.json +48 -0
- package/components/ste-sticky/ste-sticky.vue +88 -0
- package/components/ste-swipe-action/ATTRIBUTES.md +16 -0
- package/components/ste-swipe-action/README.md +195 -0
- package/components/ste-swipe-action/config.json +5 -0
- package/components/ste-swipe-action/props.ts +23 -0
- package/components/ste-swipe-action/ste-swipe-action.easycom.json +74 -0
- package/components/ste-swipe-action/ste-swipe-action.vue +138 -0
- package/components/ste-swipe-action/useData.ts +204 -0
- package/components/ste-swipe-action-group/ATTRIBUTES.md +17 -0
- package/components/ste-swipe-action-group/props.ts +22 -0
- package/components/ste-swipe-action-group/ste-swipe-action-group.easycom.json +90 -0
- package/components/ste-swipe-action-group/ste-swipe-action-group.vue +57 -0
- package/components/ste-swiper/ATTRIBUTES.md +24 -0
- package/components/ste-swiper/README.md +156 -0
- package/components/ste-swiper/config.json +5 -0
- package/components/ste-swiper/props.ts +41 -0
- package/components/ste-swiper/ste-swiper.easycom.json +123 -0
- package/components/ste-swiper/ste-swiper.vue +98 -0
- package/components/ste-swiper/useData.ts +365 -0
- package/components/ste-swiper-item/ste-swiper-item.vue +41 -0
- package/components/ste-switch/ATTRIBUTES.md +17 -0
- package/components/ste-switch/README.md +105 -0
- package/components/ste-switch/config.json +5 -0
- package/components/ste-switch/props.ts +9 -0
- package/components/ste-switch/ste-switch.easycom.json +60 -0
- package/components/ste-switch/ste-switch.vue +96 -0
- package/components/ste-tab/ATTRIBUTES.md +14 -0
- package/components/ste-tab/props.ts +25 -0
- package/components/ste-tab/ste-tab.easycom.json +56 -0
- package/components/ste-tab/ste-tab.vue +26 -0
- package/components/ste-table/ATTRIBUTES.md +41 -0
- package/components/ste-table/README.md +638 -0
- package/components/ste-table/config.json +5 -0
- package/components/ste-table/props.ts +72 -0
- package/components/ste-table/ste-table.easycom.json +188 -0
- package/components/ste-table/ste-table.vue +427 -0
- package/components/ste-table/types.d.ts +3 -0
- package/components/ste-table/useData.ts +233 -0
- package/components/ste-table/utils.ts +11 -0
- package/components/ste-table-column/checkbox-icon.vue +35 -0
- package/components/ste-table-column/common.scss +52 -0
- package/components/ste-table-column/props.ts +18 -0
- package/components/ste-table-column/radio-icon.vue +99 -0
- package/components/ste-table-column/ste-table-column.vue +169 -0
- package/components/ste-table-column/var.scss +1 -0
- package/components/ste-tabs/ATTRIBUTES.md +52 -0
- package/components/ste-tabs/README.md +165 -0
- package/components/ste-tabs/config.json +5 -0
- package/components/ste-tabs/props.ts +133 -0
- package/components/ste-tabs/ste-tabs.easycom.json +278 -0
- package/components/ste-tabs/ste-tabs.vue +447 -0
- package/components/ste-tabs/useData.ts +364 -0
- package/components/ste-text/ATTRIBUTES.md +9 -0
- package/components/ste-text/README.md +58 -0
- package/components/ste-text/config.json +6 -0
- package/components/ste-text/props.ts +10 -0
- package/components/ste-text/ste-text.easycom.json +30 -0
- package/components/ste-text/ste-text.vue +46 -0
- package/components/ste-toast/ATTRIBUTES.md +15 -0
- package/components/ste-toast/README.md +222 -0
- package/components/ste-toast/config.json +5 -0
- package/components/ste-toast/props.ts +7 -0
- package/components/ste-toast/ste-toast.easycom.json +73 -0
- package/components/ste-toast/ste-toast.vue +209 -0
- package/components/ste-toast/use-toast.ts +26 -0
- package/components/ste-touch-swipe/ATTRIBUTES.md +18 -0
- package/components/ste-touch-swipe/README.md +89 -0
- package/components/ste-touch-swipe/TouchEvent.ts +79 -0
- package/components/ste-touch-swipe/config.json +5 -0
- package/components/ste-touch-swipe/props.ts +23 -0
- package/components/ste-touch-swipe/ste-touch-swipe.easycom.json +83 -0
- package/components/ste-touch-swipe/ste-touch-swipe.vue +283 -0
- package/components/ste-touch-swipe/useData.ts +51 -0
- package/components/ste-touch-swipe-item/ste-touch-swipe-item.vue +32 -0
- package/components/ste-tour/ATTRIBUTES.md +26 -0
- package/components/ste-tour/README.md +134 -0
- package/components/ste-tour/config.json +5 -0
- package/components/ste-tour/props.ts +45 -0
- package/components/ste-tour/ste-tour.easycom.json +120 -0
- package/components/ste-tour/ste-tour.vue +152 -0
- package/components/ste-tour/useData.ts +220 -0
- package/components/ste-tree/ATTRIBUTES.md +19 -0
- package/components/ste-tree/README.md +217 -0
- package/components/ste-tree/config.json +5 -0
- package/components/ste-tree/props.ts +24 -0
- package/components/ste-tree/ste-tree.easycom.json +106 -0
- package/components/ste-tree/ste-tree.vue +140 -0
- package/components/ste-tree/useData.ts +219 -0
- package/components/ste-upload/ATTRIBUTES.md +35 -0
- package/components/ste-upload/README.md +208 -0
- package/components/ste-upload/ReadFile.ts +305 -0
- package/components/ste-upload/config.json +5 -0
- package/components/ste-upload/props.ts +25 -0
- package/components/ste-upload/ste-upload.easycom.json +267 -0
- package/components/ste-upload/ste-upload.vue +386 -0
- package/components/ste-upload/useData.ts +46 -0
- package/components/ste-video/ATTRIBUTES.md +34 -0
- package/components/ste-video/README.md +48 -0
- package/components/ste-video/config.json +5 -0
- package/components/ste-video/props.ts +86 -0
- package/components/ste-video/ste-video.easycom.json +226 -0
- package/components/ste-video/ste-video.scss +201 -0
- package/components/ste-video/ste-video.vue +390 -0
- package/components/ste-video/types.d.ts +4 -0
- package/components/ste-video/useData.ts +140 -0
- package/composables.ts +2 -0
- package/config/color.ts +16 -0
- package/config/index.ts +48 -0
- package/index.ts +118 -0
- package/package.json +22 -0
- package/store/color.ts +24 -0
- package/store/index.ts +12 -0
- package/store/message-box.ts +54 -0
- package/store/toast.ts +50 -0
- package/types/components.d.ts +124 -0
- package/types/event.d.ts +51 -0
- package/types/index.d.ts +112 -0
- package/types/refComponents.d.ts +118 -0
- package/utils/Color.ts +66 -0
- package/utils/System.ts +114 -0
- package/utils/mixin.ts +122 -0
- package/utils/utils.ts +520 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { watch, computed, useSlots, defineOptions } from 'vue';
|
|
3
|
+
import useData from './useData';
|
|
4
|
+
import type { BaseEvent } from '../../types/event';
|
|
5
|
+
import utils from '../../utils/utils';
|
|
6
|
+
import { ICON_OBJ, ANIMATION_PROP, DURATION } from './constants';
|
|
7
|
+
import type { MessageBoxOptions } from '../../types';
|
|
8
|
+
import { STE_MESSAGE_BOX_KEY } from './use-message-box';
|
|
9
|
+
import { useMsgBoxStore } from '../../store';
|
|
10
|
+
import useColor from '../../config/color';
|
|
11
|
+
let color = useColor();
|
|
12
|
+
defineOptions({
|
|
13
|
+
name: 'ste-message-box',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const slots = useSlots();
|
|
17
|
+
|
|
18
|
+
const props = defineProps<{
|
|
19
|
+
selector: string;
|
|
20
|
+
}>();
|
|
21
|
+
const customKey = props.selector || STE_MESSAGE_BOX_KEY;
|
|
22
|
+
const { getMessageBox, resetMessageBox } = useMsgBoxStore();
|
|
23
|
+
const messageBoxOption = getMessageBox(customKey);
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
animationData,
|
|
27
|
+
maskAnimationData,
|
|
28
|
+
inputValue,
|
|
29
|
+
placeholderText,
|
|
30
|
+
show,
|
|
31
|
+
showCancel,
|
|
32
|
+
title,
|
|
33
|
+
content,
|
|
34
|
+
cancelText,
|
|
35
|
+
confirmText,
|
|
36
|
+
icon,
|
|
37
|
+
editable,
|
|
38
|
+
cancelColor,
|
|
39
|
+
confirmColor,
|
|
40
|
+
confirm,
|
|
41
|
+
cancel,
|
|
42
|
+
complete,
|
|
43
|
+
showInputPlaceholder,
|
|
44
|
+
} = useData();
|
|
45
|
+
|
|
46
|
+
// 用input自带占位符时,由于动画原因导致最终显示会有一个下降的效果
|
|
47
|
+
function handleInputFocus() {
|
|
48
|
+
showInputPlaceholder.value = false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function handleInputBlur() {
|
|
52
|
+
if (!inputValue.value) {
|
|
53
|
+
showInputPlaceholder.value = true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const cmpRootStyle = computed(() => {
|
|
58
|
+
return {
|
|
59
|
+
opacity: 0,
|
|
60
|
+
'--cancel-color': cancelColor.value,
|
|
61
|
+
'--confirm-color': confirmColor.value ? confirmColor.value : color.getColor().steThemeColor,
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const cmpRootClass = computed(() => {
|
|
66
|
+
let classArr = [];
|
|
67
|
+
if (icon.value) {
|
|
68
|
+
classArr.push('icon-type');
|
|
69
|
+
}
|
|
70
|
+
if (!content.value && !slots.default) {
|
|
71
|
+
classArr.push('no-content');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (slots && slots.default) {
|
|
75
|
+
classArr.push('slot-type');
|
|
76
|
+
}
|
|
77
|
+
return classArr.join(' ');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const cmpIconCode = computed(() => {
|
|
81
|
+
if (icon.value) {
|
|
82
|
+
return ICON_OBJ[icon.value] ? ICON_OBJ[icon.value] : ICON_OBJ.info;
|
|
83
|
+
} else {
|
|
84
|
+
return ICON_OBJ.info;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
async function showBox() {
|
|
89
|
+
show.value = true;
|
|
90
|
+
await utils.sleep(50);
|
|
91
|
+
let animation = uni.createAnimation(ANIMATION_PROP);
|
|
92
|
+
let maskAnimation = uni.createAnimation(ANIMATION_PROP);
|
|
93
|
+
maskAnimation.opacity(1).step();
|
|
94
|
+
animation.scale(1, 1).step();
|
|
95
|
+
animationData.value = animation.export();
|
|
96
|
+
maskAnimationData.value = maskAnimation.export();
|
|
97
|
+
}
|
|
98
|
+
function closeBox() {
|
|
99
|
+
// 清除上次的值
|
|
100
|
+
inputValue.value = '';
|
|
101
|
+
cancelColor.value = '';
|
|
102
|
+
confirmColor.value = '';
|
|
103
|
+
|
|
104
|
+
showInputPlaceholder.value = true;
|
|
105
|
+
|
|
106
|
+
let animation = uni.createAnimation(ANIMATION_PROP);
|
|
107
|
+
let maskAnimation = uni.createAnimation(ANIMATION_PROP);
|
|
108
|
+
maskAnimation.opacity(0).step({ duration: DURATION });
|
|
109
|
+
animation.scale(0, 0).step();
|
|
110
|
+
animationData.value = animation.export();
|
|
111
|
+
maskAnimationData.value = maskAnimation.export();
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
show.value = false;
|
|
114
|
+
resetMessageBox(customKey);
|
|
115
|
+
}, DURATION);
|
|
116
|
+
}
|
|
117
|
+
function handleInput(e: Event) {
|
|
118
|
+
const baseEvent = e as unknown as BaseEvent;
|
|
119
|
+
inputValue.value = baseEvent.detail.value;
|
|
120
|
+
}
|
|
121
|
+
function handleConfirm() {
|
|
122
|
+
confirm.value(inputValue.value);
|
|
123
|
+
handleComplete();
|
|
124
|
+
}
|
|
125
|
+
function handleCancel() {
|
|
126
|
+
cancel.value(inputValue.value);
|
|
127
|
+
handleComplete();
|
|
128
|
+
}
|
|
129
|
+
function handleComplete() {
|
|
130
|
+
complete.value(inputValue.value);
|
|
131
|
+
closeBox();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function loadMessageBoxParams(options: MessageBoxOptions) {
|
|
135
|
+
title.value = options.title || '';
|
|
136
|
+
content.value = options.content || '';
|
|
137
|
+
icon.value = options.icon || '';
|
|
138
|
+
cancelText.value = options.cancelText || cancelText.value;
|
|
139
|
+
confirmText.value = options.confirmText || confirmText.value;
|
|
140
|
+
confirmColor.value = options.confirmColor || confirmColor.value;
|
|
141
|
+
showCancel.value = options.showCancel === false ? false : true;
|
|
142
|
+
cancelColor.value = options.cancelColor || cancelColor.value;
|
|
143
|
+
editable.value = !!options.editable;
|
|
144
|
+
placeholderText.value = options.placeholderText || placeholderText.value;
|
|
145
|
+
|
|
146
|
+
confirm.value = options.confirm || confirm.value;
|
|
147
|
+
cancel.value = options.cancel || cancel.value;
|
|
148
|
+
complete.value = options.complete || complete.value;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
watch(
|
|
152
|
+
() => messageBoxOption,
|
|
153
|
+
val => {
|
|
154
|
+
if (val.show) {
|
|
155
|
+
loadMessageBoxParams(val);
|
|
156
|
+
showBox();
|
|
157
|
+
} else {
|
|
158
|
+
closeBox();
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{ deep: true }
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
function showMsgBox(options: MessageBoxOptions) {
|
|
165
|
+
loadMessageBoxParams(options);
|
|
166
|
+
showBox();
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function hideMsgBox() {
|
|
170
|
+
closeBox();
|
|
171
|
+
}
|
|
172
|
+
defineExpose({
|
|
173
|
+
showMsgBox,
|
|
174
|
+
hideMsgBox,
|
|
175
|
+
});
|
|
176
|
+
</script>
|
|
177
|
+
|
|
178
|
+
<template>
|
|
179
|
+
<view class="ste-message-box-root" :style="[cmpRootStyle]" :class="[cmpRootClass]" :animation="maskAnimationData" v-if="show">
|
|
180
|
+
<view class="ste-message-box-content" :animation="animationData">
|
|
181
|
+
<view class="content-box">
|
|
182
|
+
<view class="icon-box" v-if="icon">
|
|
183
|
+
<ste-icon :code="cmpIconCode" color="#999999" size="45"></ste-icon>
|
|
184
|
+
</view>
|
|
185
|
+
<view class="ste-message-title">{{ title }}</view>
|
|
186
|
+
<view class="msg" v-if="!icon">
|
|
187
|
+
<slot>
|
|
188
|
+
<view class="text" v-if="!editable">{{ content }}</view>
|
|
189
|
+
<view v-else class="input-box">
|
|
190
|
+
<text class="placeholder-text" v-show="showInputPlaceholder">
|
|
191
|
+
{{ placeholderText }}
|
|
192
|
+
</text>
|
|
193
|
+
<input :value="inputValue" class="ste-message-box-input" @input="handleInput" @focus="handleInputFocus" @blur="handleInputBlur" />
|
|
194
|
+
</view>
|
|
195
|
+
</slot>
|
|
196
|
+
</view>
|
|
197
|
+
</view>
|
|
198
|
+
<view class="footer">
|
|
199
|
+
<view class="footer-btn cancel text" v-if="showCancel" @click="handleCancel">
|
|
200
|
+
{{ cancelText }}
|
|
201
|
+
</view>
|
|
202
|
+
<view class="footer-btn confirm text" @click="handleConfirm">
|
|
203
|
+
{{ confirmText }}
|
|
204
|
+
</view>
|
|
205
|
+
</view>
|
|
206
|
+
</view>
|
|
207
|
+
</view>
|
|
208
|
+
</template>
|
|
209
|
+
|
|
210
|
+
<style lang="scss" scoped>
|
|
211
|
+
.ste-message-box-root {
|
|
212
|
+
height: 100vh;
|
|
213
|
+
width: 100vw;
|
|
214
|
+
overflow: hidden;
|
|
215
|
+
position: fixed;
|
|
216
|
+
left: 0;
|
|
217
|
+
top: 0;
|
|
218
|
+
overflow: hidden;
|
|
219
|
+
display: flex;
|
|
220
|
+
justify-content: center;
|
|
221
|
+
align-items: center;
|
|
222
|
+
touch-action: none;
|
|
223
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
224
|
+
z-index: 99999;
|
|
225
|
+
|
|
226
|
+
&.slot-type {
|
|
227
|
+
.ste-message-title {
|
|
228
|
+
padding-bottom: 24rpx !important;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.msg {
|
|
232
|
+
padding: 0 !important;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&.icon-type {
|
|
237
|
+
.ste-message-title {
|
|
238
|
+
padding: 24rpx 0 34rpx 0 !important;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&.no-content {
|
|
243
|
+
.ste-message-title {
|
|
244
|
+
padding-bottom: 48rpx !important;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.msg {
|
|
248
|
+
padding: 0 !important;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.ste-message-box-content {
|
|
253
|
+
background: #ffffff;
|
|
254
|
+
border-radius: 16rpx;
|
|
255
|
+
// border: 2rpx solid #eeeeee;
|
|
256
|
+
min-width: 570rpx;
|
|
257
|
+
max-width: 610rpx;
|
|
258
|
+
display: inline-flex;
|
|
259
|
+
flex-direction: column;
|
|
260
|
+
transform: scale(0);
|
|
261
|
+
|
|
262
|
+
.content-box {
|
|
263
|
+
.icon-box {
|
|
264
|
+
padding-top: 4rpx;
|
|
265
|
+
height: 80rpx;
|
|
266
|
+
width: 80rpx;
|
|
267
|
+
border-radius: 50%;
|
|
268
|
+
background: #f1f1f1;
|
|
269
|
+
margin: 32rpx auto 0 auto;
|
|
270
|
+
|
|
271
|
+
display: flex;
|
|
272
|
+
align-items: center;
|
|
273
|
+
justify-content: center;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.ste-message-title {
|
|
277
|
+
width: 100%;
|
|
278
|
+
padding-top: 48rpx;
|
|
279
|
+
padding-bottom: 24rpx;
|
|
280
|
+
font-weight: bold;
|
|
281
|
+
font-size: var(--font-size-32, 32rpx);
|
|
282
|
+
text-align: center;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.msg {
|
|
286
|
+
padding: 0 32rpx 48rpx 32rpx;
|
|
287
|
+
text-align: center;
|
|
288
|
+
|
|
289
|
+
.text {
|
|
290
|
+
width: 100%;
|
|
291
|
+
font-size: var(--font-size-28, 28rpx);
|
|
292
|
+
text-align: center;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.input-box {
|
|
296
|
+
position: relative;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.placeholder-text {
|
|
300
|
+
position: absolute;
|
|
301
|
+
left: 50%;
|
|
302
|
+
top: 50%;
|
|
303
|
+
transform: translate(-50%, -50%);
|
|
304
|
+
color: #999999;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.ste-message-box-input {
|
|
308
|
+
height: 80rpx;
|
|
309
|
+
width: 548rpx;
|
|
310
|
+
background: #f5f5f5;
|
|
311
|
+
|
|
312
|
+
border-radius: 8px 8px 8px 8px;
|
|
313
|
+
text-align: center;
|
|
314
|
+
padding: 0 24rpx;
|
|
315
|
+
font-size: var(--font-size-28, 28rpx);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.footer {
|
|
321
|
+
display: flex;
|
|
322
|
+
height: 96rpx;
|
|
323
|
+
|
|
324
|
+
.footer-btn {
|
|
325
|
+
height: 100%;
|
|
326
|
+
border-top: 2rpx solid #eeeeee;
|
|
327
|
+
border-right: 2rpx solid #eeeeee;
|
|
328
|
+
flex: 1;
|
|
329
|
+
|
|
330
|
+
display: flex;
|
|
331
|
+
align-items: center;
|
|
332
|
+
justify-content: center;
|
|
333
|
+
font-weight: bold;
|
|
334
|
+
font-size: var(--font-size-32, 32rpx);
|
|
335
|
+
|
|
336
|
+
/* #ifdef H5 || WEB */
|
|
337
|
+
cursor: pointer;
|
|
338
|
+
/* #endif */
|
|
339
|
+
|
|
340
|
+
&.cancel {
|
|
341
|
+
color: var(--cancel-color);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
&.confirm {
|
|
345
|
+
color: var(--confirm-color);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
& + .footer-btn {
|
|
349
|
+
border-right: none;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MessageBoxOptions } from '../../types'
|
|
2
|
+
import { useMsgBoxStore } from '../../store'
|
|
3
|
+
|
|
4
|
+
export const STE_MESSAGE_BOX_KEY = '$steMsgBoxKey'
|
|
5
|
+
export function useMessageBox(key: string = STE_MESSAGE_BOX_KEY) {
|
|
6
|
+
const store = useMsgBoxStore()
|
|
7
|
+
|
|
8
|
+
// 初始化
|
|
9
|
+
store.initializeState(key)
|
|
10
|
+
|
|
11
|
+
return {
|
|
12
|
+
showMsgBox(params: MessageBoxOptions) {
|
|
13
|
+
store.setMessageBox({
|
|
14
|
+
key,
|
|
15
|
+
params: {
|
|
16
|
+
...params,
|
|
17
|
+
show: true,
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
hideMsgBox() {
|
|
23
|
+
store.resetMessageBox(key)
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import { DEFAULT_CONFIG, type MessageBoxIcon } from './constants'
|
|
3
|
+
|
|
4
|
+
export default function useData() {
|
|
5
|
+
const title = ref(DEFAULT_CONFIG.title)
|
|
6
|
+
const content = ref('')
|
|
7
|
+
const icon = ref<MessageBoxIcon | ''>('')
|
|
8
|
+
const cancelText = ref(DEFAULT_CONFIG.cancelText)
|
|
9
|
+
const cancelColor = ref(DEFAULT_CONFIG.cancelColor)
|
|
10
|
+
const confirmText = ref(DEFAULT_CONFIG.confirmText)
|
|
11
|
+
const confirmColor = ref(DEFAULT_CONFIG.confirmColor)
|
|
12
|
+
const showCancel = ref(DEFAULT_CONFIG.showCancel)
|
|
13
|
+
const editable = ref(DEFAULT_CONFIG.editable)
|
|
14
|
+
const placeholderText = ref('')
|
|
15
|
+
const inputType = ref('')
|
|
16
|
+
const confirm = ref((_value?: string) => {})
|
|
17
|
+
const cancel = ref((_value?: string) => {})
|
|
18
|
+
const complete = ref((_value?: string) => {})
|
|
19
|
+
|
|
20
|
+
// 内部值
|
|
21
|
+
const pageShow = ref(true)
|
|
22
|
+
const show = ref(false)
|
|
23
|
+
const inputValue = ref('')
|
|
24
|
+
const animationData = ref(null)
|
|
25
|
+
const maskAnimationData = ref(null)
|
|
26
|
+
|
|
27
|
+
const open = ref(false)
|
|
28
|
+
const tmpMsg = ref(null)
|
|
29
|
+
|
|
30
|
+
const showInputPlaceholder = ref(true)
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
title,
|
|
34
|
+
content,
|
|
35
|
+
icon,
|
|
36
|
+
cancelText,
|
|
37
|
+
cancelColor,
|
|
38
|
+
confirmText,
|
|
39
|
+
confirmColor,
|
|
40
|
+
showCancel,
|
|
41
|
+
editable,
|
|
42
|
+
placeholderText,
|
|
43
|
+
inputType,
|
|
44
|
+
confirm,
|
|
45
|
+
cancel,
|
|
46
|
+
complete,
|
|
47
|
+
pageShow,
|
|
48
|
+
show,
|
|
49
|
+
inputValue,
|
|
50
|
+
animationData,
|
|
51
|
+
maskAnimationData,
|
|
52
|
+
open,
|
|
53
|
+
tmpMsg,
|
|
54
|
+
showInputPlaceholder,
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#### Props
|
|
2
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
|
+
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
|
+
| `list` | 滚动数据列表 | `Array` | `[]` | - | - |
|
|
5
|
+
| `direction` | 滚动的方向 | `String` | `across` | `across`:水平<br/>`vertical`:垂直 | - |
|
|
6
|
+
| `closeMode` | 是否启用关闭模式 | `Boolean` | `false` | - | - |
|
|
7
|
+
| `color` | 文字颜色 | `String` | `#000000` | - | - |
|
|
8
|
+
| `background` | 背景 | `String` | `#ffffff` | - | - |
|
|
9
|
+
| `width` | 宽度 | `Number/String` | `100%` | `100%`:填满<br/>`{{Number}} `:自定义宽度,单位rpx | - |
|
|
10
|
+
| `acrossSpeed` | 滚动速率 (px/s) | `Number` | `50` | - | - |
|
|
11
|
+
| `verticalSpeed` | 滚动的速度(ms) | `Number` | `500` | - | - |
|
|
12
|
+
| `delay` | 延时(ms | `Number` | `1000` | - | - |
|
|
13
|
+
| `standTime` | 每次滚动前停留多少毫秒(竖向滚动时有效)(ms) | `Number` | `1000` | - | - |
|
|
14
|
+
| `scrollable` | 是否可以滚动 | `Boolean` | `true` | - | - |
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#### Events
|
|
18
|
+
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
19
|
+
| ----- | ----- | ------- | -------- |
|
|
20
|
+
| `click` | 外层点击事件回调 | - | - |
|
|
21
|
+
| `close` | 关闭通知栏时触发 | - | - |
|
|
22
|
+
| `end` | 滚动结束时触发 | - | - |
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# NoticeBar 公告栏
|
|
2
|
+
|
|
3
|
+
用于循环播放展示一组消息通知。
|
|
4
|
+
|
|
5
|
+
---$
|
|
6
|
+
|
|
7
|
+
### 代码演示
|
|
8
|
+
|
|
9
|
+
JavaScript后面的演示代码中涉及到的变量和方法都使用本`javascript
|
|
10
|
+
`代码
|
|
11
|
+
|
|
12
|
+
```javascript
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
let list = ref(['第一条:1111111111111111111111111111', '第二条:2222222222222222222222', '第三条:3333333333333']);
|
|
15
|
+
let list2 = ref(['第一条:111', '第二条:222', '第三条:333', '第四条:444']);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
#### 基础用法
|
|
19
|
+
|
|
20
|
+
通过`list`数组参数设置需要滚动的内容,水平滚动。
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<ste-notice-bar :list="list"></ste-notice-bar>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
#### 自定义样式
|
|
27
|
+
|
|
28
|
+
- 通过 `color` 属性设置文字颜色,默认为 `#000000`。
|
|
29
|
+
- 通过 `background` 属性设置背景,默认为 `#ffffff`。
|
|
30
|
+
- 通过 `width` 属性设置宽度,默认为 `100%`,继承父属性。
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
<ste-notice-bar :list="list" background="#FBF8DC" color="red" :width="400"></ste-notice-bar>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### 垂直滚动
|
|
37
|
+
|
|
38
|
+
通过`direction`设置滚动的方向,`across`:水平,`vertical`:垂直 水平滚动、默认`across`。
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<ste-notice-bar :list="list" direction="vertical"></ste-notice-bar>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
#### 滚动速率
|
|
45
|
+
|
|
46
|
+
通过`acrossSpeed`设置水平方向的滚动速率 `(px/s)`。
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<ste-notice-bar :list="list" :acrossSpeed="10"></ste-notice-bar>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### 滚动的速度
|
|
53
|
+
|
|
54
|
+
通过`verticalSpeed`设置垂直方向的滚动的速度`(ms)`。
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<ste-notice-bar :list="list2" direction="vertical" :verticalSpeed="2000"></ste-notice-bar>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### 延时滚动
|
|
61
|
+
|
|
62
|
+
通过`delay`设置延时`(ms)`。
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<ste-notice-bar :list="list" :delay="10000"></ste-notice-bar>
|
|
66
|
+
<ste-notice-bar :list="list2" direction="vertical" delay="10000"></ste-notice-bar>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### 停留时间
|
|
70
|
+
|
|
71
|
+
通过`standTime`设置每次滚动前停留多少毫秒(竖向滚动时有效)`(ms)`。
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<ste-notice-bar :list="list2" direction="vertical" :standTime="5000"></ste-notice-bar>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### 是否可以滚动
|
|
78
|
+
|
|
79
|
+
通过`scrollable`设置公共栏是否可以滚动,默认`true`。
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<ste-notice-bar :list="list" :scrollable="false"></ste-notice-bar>
|
|
83
|
+
<ste-notice-bar :list="list2" direction="vertical" :scrollable="false"></ste-notice-bar>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### 取消按钮
|
|
87
|
+
|
|
88
|
+
通过`closeMode`设置是否启用关闭模式,默认`false`。
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<ste-notice-bar :list="list" closeMode></ste-notice-bar>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### 插槽
|
|
95
|
+
|
|
96
|
+
通过`leftIcon`设置左边图标的插槽。
|
|
97
|
+
通过`rightIcon`设置右边图标的插槽。
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<ste-notice-bar :list="list">
|
|
101
|
+
<template #leftIcon>
|
|
102
|
+
<ste-icon color="#000000" code="" size="32"></ste-icon>
|
|
103
|
+
</template>
|
|
104
|
+
<template #rightIcon>
|
|
105
|
+
<ste-icon color="#000000" code="" size="32"></ste-icon>
|
|
106
|
+
</template>
|
|
107
|
+
</ste-notice-bar>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---$
|
|
111
|
+
|
|
112
|
+
### API
|
|
113
|
+
|
|
114
|
+
<!-- props -->
|
|
115
|
+
|
|
116
|
+
#### 组件插槽(Slots)
|
|
117
|
+
|
|
118
|
+
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
119
|
+
| ----------- | -------------- | -------- | -------- |
|
|
120
|
+
| `leftIcon` | 左边图标的插槽 | - | |
|
|
121
|
+
| `rightIcon` | 右边图标的插槽 | - | |
|
|
122
|
+
|
|
123
|
+
---$
|
|
124
|
+
{{qinpengfei}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PropType } from 'vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
list: { type: Array as PropType<string[]>, default: () => [] },
|
|
5
|
+
direction: { type: String, default: 'across' },
|
|
6
|
+
closeMode: { type: Boolean, default: false },
|
|
7
|
+
color: { type: String, default: '#000000' },
|
|
8
|
+
background: { type: String, default: '#ffffff' },
|
|
9
|
+
width: { type: [String, Number], default: '100%' },
|
|
10
|
+
acrossSpeed: { type: Number, default: 50 },
|
|
11
|
+
verticalSpeed: { type: Number, default: 500 },
|
|
12
|
+
delay: { type: Number, default: 1000 },
|
|
13
|
+
standTime: { type: Number, default: 1000 },
|
|
14
|
+
scrollable: { type: Boolean, default: true },
|
|
15
|
+
}
|