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,113 @@
|
|
|
1
|
+
@import './animate.scss'; // 所有动画
|
|
2
|
+
.ste-animate-root {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
|
|
5
|
+
&[class*='ste-animate-'] {
|
|
6
|
+
animation-duration: 0.5s;
|
|
7
|
+
animation-timing-function: ease-out;
|
|
8
|
+
animation-fill-mode: both;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// 循环
|
|
12
|
+
&.loop {
|
|
13
|
+
animation-iteration-count: infinite !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// 横向抖动
|
|
17
|
+
&.ste-animate-shakeX {
|
|
18
|
+
animation-name: shakeX;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// 竖向抖动
|
|
22
|
+
&.ste-animate-shakeY {
|
|
23
|
+
animation-name: shakeY;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 心跳
|
|
27
|
+
&.ste-animate-ripple {
|
|
28
|
+
animation-name: ripple;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 漂浮
|
|
32
|
+
&.ste-animate-float {
|
|
33
|
+
position: relative;
|
|
34
|
+
animation-name: floatPop;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// 呼吸灯
|
|
38
|
+
&.ste-animate-breath {
|
|
39
|
+
animation-name: breath;
|
|
40
|
+
animation-duration: 2700ms;
|
|
41
|
+
animation-timing-function: ease-in-out;
|
|
42
|
+
animation-direction: alternate;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 右侧向左侧划入
|
|
46
|
+
&.ste-animate-slide-right {
|
|
47
|
+
animation-name: slide-right;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 右侧向左侧划入
|
|
51
|
+
&.ste-animate-slide-left {
|
|
52
|
+
animation-name: slide-left;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 上面向下面划入
|
|
56
|
+
&.ste-animate-slide-top {
|
|
57
|
+
animation-name: slide-top;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 下面向上面划入
|
|
61
|
+
&.ste-animate-slide-bottom {
|
|
62
|
+
animation-name: slide-bottom;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.ste-animate-jump {
|
|
66
|
+
transform-origin: center center;
|
|
67
|
+
animation: jump 0.7s linear;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.ste-animate-twinkle {
|
|
71
|
+
position: relative;
|
|
72
|
+
|
|
73
|
+
&::after,
|
|
74
|
+
&::before {
|
|
75
|
+
position: absolute;
|
|
76
|
+
right: 50%;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
width: 60px;
|
|
80
|
+
height: 60px;
|
|
81
|
+
margin-top: -15px;
|
|
82
|
+
margin-right: -30px;
|
|
83
|
+
content: '';
|
|
84
|
+
border: 4rpx solid rgba(255, 255, 255, 0.6);
|
|
85
|
+
border-radius: 30px;
|
|
86
|
+
transform: scale(0);
|
|
87
|
+
animation: twinkle 2s ease-out infinite;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&::after {
|
|
91
|
+
animation-delay: 0.4s;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.ste-animate-flicker {
|
|
96
|
+
position: relative;
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
|
|
99
|
+
&::after {
|
|
100
|
+
position: absolute;
|
|
101
|
+
top: -2rpx;
|
|
102
|
+
left: 0;
|
|
103
|
+
width: 200rpx;
|
|
104
|
+
height: 102%;
|
|
105
|
+
content: '';
|
|
106
|
+
background-image: linear-gradient(106deg, rgba(232, 224, 255, 0) 24%, #e8e0ff 91%);
|
|
107
|
+
filter: blur(6rpx);
|
|
108
|
+
opacity: 0.73;
|
|
109
|
+
transform: skew(-20deg);
|
|
110
|
+
animation: flicker 1.5s linear infinite;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed, ref, type CSSProperties, nextTick, watch, defineOptions } from 'vue';
|
|
3
|
+
import propsData from './props';
|
|
4
|
+
|
|
5
|
+
const props = defineProps(propsData);
|
|
6
|
+
|
|
7
|
+
const componentName = `ste-animate`;
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: componentName,
|
|
10
|
+
options: {
|
|
11
|
+
virtualHost: true,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const animationFlag = ref(false); // 通过此标识控制动画执行
|
|
16
|
+
|
|
17
|
+
const cmpRootClass = computed(() => {
|
|
18
|
+
let classArr: string[] = [];
|
|
19
|
+
if (props.type && (props.action === 'initial' || animationFlag.value || props.loop)) {
|
|
20
|
+
classArr.push(`ste-animate-${props.type}`);
|
|
21
|
+
}
|
|
22
|
+
if (props.loop) {
|
|
23
|
+
classArr.push('loop');
|
|
24
|
+
}
|
|
25
|
+
return classArr.join(' ');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const cmpRootStyle = computed(() => {
|
|
29
|
+
let style: CSSProperties = {};
|
|
30
|
+
if (props.duration) {
|
|
31
|
+
style.animationDuration = `${props.duration / 1000}s`;
|
|
32
|
+
}
|
|
33
|
+
return style;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
watch(
|
|
37
|
+
() => props.show,
|
|
38
|
+
val => {
|
|
39
|
+
if (val) {
|
|
40
|
+
animated();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
function handleClick() {
|
|
46
|
+
if (props.action === 'click') {
|
|
47
|
+
animated();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function animated() {
|
|
52
|
+
animationFlag.value = false;
|
|
53
|
+
nextTick(() => {
|
|
54
|
+
animationFlag.value = true;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<view class="ste-animate-root" :class="[cmpRootClass]" :style="[cmpRootStyle]" @click="handleClick">
|
|
61
|
+
<slot></slot>
|
|
62
|
+
</view>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<style lang="scss" scoped>
|
|
66
|
+
@import './ste-animate.scss';
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#### Props
|
|
2
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
|
+
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
|
+
| `content` | 徽标内容 | `string / number` | - | - | - |
|
|
5
|
+
| `background` | 背景 | `string` | `#ee0a24` | - | - |
|
|
6
|
+
| `showDot` | 是否展示为小红点 | `boolean` | `false` | - | - |
|
|
7
|
+
| `offsetX` | 根据徽标位置,设置x轴偏移量 | `string / number` | `auto` | - | - |
|
|
8
|
+
| `offsetY` | 根据徽标位置,设置y轴偏移量 | `string / number` | `auto` | - | - |
|
|
9
|
+
| `showZero` | 当 content 为数字 0,是否展示徽标 | `boolean` | `false` | - | - |
|
|
10
|
+
| `position` | 徽标位置 | `string` | `topRight` | `topRight`:上右<br/>`topLeft`:上左<br/>`bottomLeft`:下左<br/>`bottomRight`:下右 | - |
|
|
11
|
+
| `max` | 徽标最大显示值 | `number` | `99` | - | - |
|
|
12
|
+
| `showBorder` | 是否显示边框 | `boolean` | `false` | - | - |
|
|
13
|
+
| `borderColor` | 边框颜色 | `string` | - | - | - |
|
|
14
|
+
| `zIndex` | 层级 | `number` | `2` | - | - |
|
|
15
|
+
| `isInline` | display属性是否为inline-block | `boolean` | `false` | - | - |
|
|
16
|
+
|
|
17
|
+
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Badge 徽标
|
|
2
|
+
|
|
3
|
+
在右上角展示徽标数字或小红点。
|
|
4
|
+
|
|
5
|
+
---$
|
|
6
|
+
|
|
7
|
+
### 代码演示
|
|
8
|
+
|
|
9
|
+
- 以下代码公共样式
|
|
10
|
+
|
|
11
|
+
```css
|
|
12
|
+
.avator {
|
|
13
|
+
height: 80rpx;
|
|
14
|
+
width: 80rpx;
|
|
15
|
+
border-radius: 8rpx;
|
|
16
|
+
background-color: #f2f3f5;
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
#### 徽标内容
|
|
21
|
+
|
|
22
|
+
通过`content`属性,设置子元素的右上角的徽标
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<ste-badge content="1">
|
|
26
|
+
<view class="avator"></view>
|
|
27
|
+
</ste-badge>
|
|
28
|
+
<ste-badge content="99+">
|
|
29
|
+
<view class="avator"></view>
|
|
30
|
+
</ste-badge>
|
|
31
|
+
<ste-badge content="hot">
|
|
32
|
+
<view class="avator"></view>
|
|
33
|
+
</ste-badge>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### 背景
|
|
37
|
+
|
|
38
|
+
通过`background`属性,设置徽标内容的背景
|
|
39
|
+
|
|
40
|
+
- 支持纯色、渐变色、背景图
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<ste-badge content="1" background="rgb(19, 183, 22)">
|
|
44
|
+
<view class="avator"></view>
|
|
45
|
+
</ste-badge>
|
|
46
|
+
<ste-badge content="99+" background="linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186))">
|
|
47
|
+
<view class="avator"></view>
|
|
48
|
+
</ste-badge>
|
|
49
|
+
<ste-badge content="" showZero background="https://image.whzb.com/chain/StellarUI/image/fire.png">
|
|
50
|
+
<view class="avator"></view>
|
|
51
|
+
</ste-badge>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### 小红点
|
|
55
|
+
|
|
56
|
+
通过`showDot`属性,设置是否显示小红点
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
<ste-badge showDot>
|
|
60
|
+
<view class="avator"></view>
|
|
61
|
+
</ste-badge>
|
|
62
|
+
<ste-badge showDot background="rgb(19, 183, 22)">
|
|
63
|
+
<view class="avator"></view>
|
|
64
|
+
</ste-badge>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### 徽标位置
|
|
68
|
+
|
|
69
|
+
通过`position`属性,设置徽标的位置
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<ste-badge content="1">
|
|
73
|
+
<view class="avator"></view>
|
|
74
|
+
</ste-badge>
|
|
75
|
+
<ste-badge content="1" position="topLeft">
|
|
76
|
+
<view class="avator"></view>
|
|
77
|
+
</ste-badge>
|
|
78
|
+
<ste-badge content="1" position="bottomLeft">
|
|
79
|
+
<view class="avator"></view>
|
|
80
|
+
</ste-badge>
|
|
81
|
+
<ste-badge content="1" position="bottomRight">
|
|
82
|
+
<view class="avator"></view>
|
|
83
|
+
</ste-badge>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### 偏移
|
|
87
|
+
|
|
88
|
+
当设置了`offsetX`或`offsetY`值时,徽标会基于当前设置徽标位置(`position`)往中心点进行偏移
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<ste-badge content="1" :offsetX="5" :offsetY="5">
|
|
92
|
+
<view class="avator"></view>
|
|
93
|
+
</ste-badge>
|
|
94
|
+
<ste-badge content="1" position="topLeft" :offsetX="5" :offsetY="5">
|
|
95
|
+
<view class="avator"></view>
|
|
96
|
+
</ste-badge>
|
|
97
|
+
<ste-badge content="1" position="bottomLeft" :offsetX="5" :offsetY="5">
|
|
98
|
+
<view class="avator"></view>
|
|
99
|
+
</ste-badge>
|
|
100
|
+
<ste-badge content="1" position="bottomRight" :offsetX="5" :offsetY="5">
|
|
101
|
+
<view class="avator"></view>
|
|
102
|
+
</ste-badge>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### 为0时是否显示徽标
|
|
106
|
+
|
|
107
|
+
当`content`为`Number`类型时并且值等于`0`时,默认不会显示,如果`showZero`为`true`,则会显示
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<ste-badge :content="0" showZero>
|
|
111
|
+
<view class="avator"></view>
|
|
112
|
+
</ste-badge>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### 最大值
|
|
116
|
+
|
|
117
|
+
当`content`为`Number`类型时并且值大于`max`时,会显示`{{max}}+`,`max`默认值为`99`
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<ste-badge :content="100">
|
|
121
|
+
<view class="avator"></view>
|
|
122
|
+
</ste-badge>
|
|
123
|
+
<ste-badge :content="99">
|
|
124
|
+
<view class="avator"></view>
|
|
125
|
+
</ste-badge>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### 自定义内容
|
|
129
|
+
|
|
130
|
+
通过`content`插槽,自定义徽标的内容
|
|
131
|
+
|
|
132
|
+
```html
|
|
133
|
+
<ste-badge>
|
|
134
|
+
<template #content>
|
|
135
|
+
<ste-icon code="" size="18"></ste-icon>
|
|
136
|
+
</template>
|
|
137
|
+
<view class="avator"></view>
|
|
138
|
+
</ste-badge>
|
|
139
|
+
<ste-badge>
|
|
140
|
+
<template #content>
|
|
141
|
+
<ste-icon code="" size="12"></ste-icon>
|
|
142
|
+
</template>
|
|
143
|
+
<view class="avator"></view>
|
|
144
|
+
</ste-badge>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---$
|
|
148
|
+
|
|
149
|
+
### API
|
|
150
|
+
|
|
151
|
+
<!-- props -->
|
|
152
|
+
|
|
153
|
+
#### 组件插槽(Slots)
|
|
154
|
+
|
|
155
|
+
| 名称 | 说明 | 支持版本 |
|
|
156
|
+
| ------- | -------------- | -------- |
|
|
157
|
+
| default | 默认插槽 | - |
|
|
158
|
+
| content | 自定义徽标内容 | - |
|
|
159
|
+
|
|
160
|
+
---$
|
|
161
|
+
|
|
162
|
+
{{fuyuwei}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AroundPositionType } from '../../types'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
content: [String, Number],
|
|
5
|
+
background: { type: String, default: '#ee0a24' },
|
|
6
|
+
showDot: Boolean,
|
|
7
|
+
offsetX: { type: [String, Number], default: 'auto' },
|
|
8
|
+
offsetY: { type: [String, Number], default: 'auto' },
|
|
9
|
+
showZero: Boolean,
|
|
10
|
+
position: { type: String as PropType<AroundPositionType>, default: 'topRight' },
|
|
11
|
+
max: { type: Number, default: 99 },
|
|
12
|
+
showBorder: { type: Boolean, default: false },
|
|
13
|
+
borderColor: { type: String, default: '' },
|
|
14
|
+
zIndex: { type: [Number, String], default: 2 },
|
|
15
|
+
isInline: { type: Boolean, default: false },
|
|
16
|
+
rootStyle: { type: Object, default: () => {} },
|
|
17
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ste-badge",
|
|
3
|
+
"description": "徽标组件",
|
|
4
|
+
"example": "<ste-badge></ste-badge>",
|
|
5
|
+
"tutorial": "https://stellar-ui.intecloud.com.cn/plus/#/?active=badge",
|
|
6
|
+
"attributes": [
|
|
7
|
+
{
|
|
8
|
+
"name": "content",
|
|
9
|
+
"description": "徽标内容",
|
|
10
|
+
"type": "string | number"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "background",
|
|
14
|
+
"description": "背景",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"default": "#ee0a24"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "showDot",
|
|
20
|
+
"description": "是否展示为小红点",
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"default": false
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "offsetX",
|
|
26
|
+
"description": "根据徽标位置,设置x轴偏移量",
|
|
27
|
+
"type": "string | number",
|
|
28
|
+
"default": "auto"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "offsetY",
|
|
32
|
+
"description": "根据徽标位置,设置y轴偏移量",
|
|
33
|
+
"type": "string | number",
|
|
34
|
+
"default": "auto"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "showZero",
|
|
38
|
+
"description": "当 content 为数字 0,是否展示徽标",
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "position",
|
|
44
|
+
"description": "徽标位置",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"values": [
|
|
47
|
+
{
|
|
48
|
+
"name": "topRight",
|
|
49
|
+
"description": "上右"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "topLeft",
|
|
53
|
+
"description": "上左"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "bottomLeft",
|
|
57
|
+
"description": "下左"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "bottomRight",
|
|
61
|
+
"description": "下右"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"default": "topRight"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "max",
|
|
68
|
+
"description": "徽标最大显示值",
|
|
69
|
+
"type": "number",
|
|
70
|
+
"default": 99
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "showBorder",
|
|
74
|
+
"description": "是否显示边框",
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"default": false
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "borderColor",
|
|
80
|
+
"description": "边框颜色",
|
|
81
|
+
"type": "string"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "zIndex",
|
|
85
|
+
"description": "层级",
|
|
86
|
+
"type": "number",
|
|
87
|
+
"default": 2
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "isInline",
|
|
91
|
+
"description": "display属性是否为inline-block",
|
|
92
|
+
"type": "boolean",
|
|
93
|
+
"default": false
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, defineOptions, type CSSProperties } from 'vue';
|
|
3
|
+
import utils from '../../utils/utils';
|
|
4
|
+
import propsData from './props';
|
|
5
|
+
|
|
6
|
+
const componentName = `ste-badge`;
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: componentName,
|
|
10
|
+
options: {
|
|
11
|
+
virtualHost: true,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const props = defineProps(propsData);
|
|
16
|
+
|
|
17
|
+
const emits = defineEmits<{
|
|
18
|
+
(e: 'click', event?: Event): void;
|
|
19
|
+
}>();
|
|
20
|
+
|
|
21
|
+
const cmpContentStyle = computed(() => {
|
|
22
|
+
let style = {} as CSSProperties;
|
|
23
|
+
if (props.background) {
|
|
24
|
+
style = { backgroundColor: 'transparent', ...utils.bg2style(props.background) };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const offsetX = String(props.offsetX);
|
|
28
|
+
const offsetY = String(props.offsetY);
|
|
29
|
+
if ((offsetX !== 'auto' && offsetX !== '0') || (offsetY !== 'auto' && offsetY !== '0')) {
|
|
30
|
+
style.transform = 'translate(0, 0)';
|
|
31
|
+
style[props.position === 'topLeft' || props.position === 'bottomLeft' ? 'left' : 'right'] = utils.addUnit(props[props.position.includes('Left') ? 'offsetX' : 'offsetY']);
|
|
32
|
+
style[props.position === 'topRight' || props.position === 'topLeft' ? 'top' : 'bottom'] = utils.addUnit(props[props.position.includes('Top') ? 'offsetX' : 'offsetY']);
|
|
33
|
+
}
|
|
34
|
+
if (props.showBorder) {
|
|
35
|
+
style.border = 'solid 1px ' + props.borderColor;
|
|
36
|
+
}
|
|
37
|
+
style['z-index'] = props.zIndex;
|
|
38
|
+
|
|
39
|
+
return style;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const cmpShowContent = computed(() => {
|
|
43
|
+
return props.showZero ? true : props.content && props.content != '0';
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const cmpContent = computed(() => {
|
|
47
|
+
if (utils.isNumber(String(props.content)) && Number(props.content) > props.max) {
|
|
48
|
+
return `${props.max}+`;
|
|
49
|
+
} else {
|
|
50
|
+
return String(props.content);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const cmpIsSmall = computed(() => {
|
|
55
|
+
return (props.content && String(props.content).length == 1) || Number(props.content) < 10;
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<view class="ste-badge-root" :style="[rootStyle as any, { display: isInline ? 'inline-block' : 'block' }]">
|
|
61
|
+
<view class="ste-badge-content" :style="[cmpContentStyle]" :class="'ste-badge-' + position" v-if="showDot || cmpShowContent || $slots.content">
|
|
62
|
+
<view v-if="showDot" class="dot-box" />
|
|
63
|
+
<view v-else class="content-box" :class="{ 'no-padding': $slots.content || cmpIsSmall }">
|
|
64
|
+
<slot name="content">
|
|
65
|
+
<view class="ste-badge-content-text">{{ cmpContent }}</view>
|
|
66
|
+
</slot>
|
|
67
|
+
</view>
|
|
68
|
+
</view>
|
|
69
|
+
<slot></slot>
|
|
70
|
+
</view>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<style lang="scss" scoped>
|
|
74
|
+
$default-size: 28rpx;
|
|
75
|
+
|
|
76
|
+
.ste-badge-root {
|
|
77
|
+
position: relative;
|
|
78
|
+
|
|
79
|
+
.ste-badge-content {
|
|
80
|
+
display: inline-block;
|
|
81
|
+
position: absolute;
|
|
82
|
+
font-size: var(--font-size-24, 24rpx);
|
|
83
|
+
color: #ffffff;
|
|
84
|
+
background-color: #ee0a24;
|
|
85
|
+
border-radius: 99999rpx;
|
|
86
|
+
width: fit-content;
|
|
87
|
+
background-size: cover;
|
|
88
|
+
|
|
89
|
+
.content-box {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
height: $default-size;
|
|
94
|
+
max-height: $default-size;
|
|
95
|
+
min-height: $default-size;
|
|
96
|
+
width: auto;
|
|
97
|
+
min-width: $default-size;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
|
|
100
|
+
padding: 0 8rpx;
|
|
101
|
+
line-height: 0;
|
|
102
|
+
|
|
103
|
+
&.no-padding {
|
|
104
|
+
padding: 0;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.dot-box {
|
|
109
|
+
height: 12rpx;
|
|
110
|
+
width: 12rpx;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&-text {
|
|
114
|
+
font-size: var(--font-size-22, 22rpx);
|
|
115
|
+
color: #ffffff;
|
|
116
|
+
line-height: $default-size;
|
|
117
|
+
vertical-align: middle;
|
|
118
|
+
position: relative;
|
|
119
|
+
// #ifdef H5
|
|
120
|
+
top: -0.5rpx;
|
|
121
|
+
// #endif
|
|
122
|
+
// #ifdef MP-WEIXIN
|
|
123
|
+
// top: -0.5rpx;
|
|
124
|
+
// #endif
|
|
125
|
+
// #ifdef MP-ALIPAY
|
|
126
|
+
// top: 0.5rpx;
|
|
127
|
+
// #endif
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ste-badge- {
|
|
132
|
+
&topRight {
|
|
133
|
+
top: 0;
|
|
134
|
+
right: 0;
|
|
135
|
+
transform: translate(50%, -50%);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&topLeft {
|
|
139
|
+
top: 0;
|
|
140
|
+
left: 0;
|
|
141
|
+
transform: translate(-50%, -50%);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&bottomLeft {
|
|
145
|
+
bottom: 0;
|
|
146
|
+
left: 0;
|
|
147
|
+
transform: translate(-50%, 50%);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&bottomRight {
|
|
151
|
+
bottom: 0;
|
|
152
|
+
right: 0;
|
|
153
|
+
transform: translate(50%, 50%);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#### Props
|
|
2
|
+
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
|
+
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
|
+
| `content` | 条形码内容(仅支持数字和字母) | `string` | - | - | - |
|
|
5
|
+
| `width` | 条形码宽度,单位`px` | `number` | - | - | - |
|
|
6
|
+
| `height` | 条形码高度,单位`px` | `number` | - | - | - |
|
|
7
|
+
| `background` | 背景色 | `string` | - | - | - |
|
|
8
|
+
| `foreground` | 前景色(条形码画笔颜色) | `string` | - | - | - |
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
#### Events
|
|
12
|
+
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
13
|
+
| ----- | ----- | ------- | -------- |
|
|
14
|
+
| `loadImage` | 加载完成后返回条形码对应的图片数据 | `src`:图片数据 | - |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Barcode 条形码
|
|
2
|
+
|
|
3
|
+
能够将数字和字母转换生成条形码的组件,支持自定义配色
|
|
4
|
+
|
|
5
|
+
---$
|
|
6
|
+
|
|
7
|
+
### 代码演示
|
|
8
|
+
|
|
9
|
+
#### 基础使用
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<ste-barcode content="123456abc123" />
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
#### 自定义颜色
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<ste-barcode content="123456abc123" foreground="#c11" background="#dad" />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---$
|
|
22
|
+
|
|
23
|
+
### API
|
|
24
|
+
|
|
25
|
+
<!-- props -->
|
|
26
|
+
|
|
27
|
+
---$
|
|
28
|
+
{{fuyuwei}}
|