uview-ui-wjf 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +71 -0
- package/changelog.md +388 -0
- package/components/u--form/u--form.vue +92 -0
- package/components/u--image/u--image.vue +73 -0
- package/components/u--input/u--input.vue +115 -0
- package/components/u--text/u--text.vue +72 -0
- package/components/u--textarea/u--textarea.vue +85 -0
- package/components/u-action-sheet/props.js +54 -0
- package/components/u-action-sheet/u-action-sheet.vue +278 -0
- package/components/u-album/props.js +59 -0
- package/components/u-album/u-album.vue +259 -0
- package/components/u-alert/props.js +44 -0
- package/components/u-alert/u-alert.vue +243 -0
- package/components/u-avatar/props.js +78 -0
- package/components/u-avatar/u-avatar.vue +173 -0
- package/components/u-avatar-group/props.js +52 -0
- package/components/u-avatar-group/u-avatar-group.vue +103 -0
- package/components/u-back-top/props.js +54 -0
- package/components/u-back-top/u-back-top.vue +129 -0
- package/components/u-badge/props.js +72 -0
- package/components/u-badge/u-badge.vue +171 -0
- package/components/u-button/nvue.scss +46 -0
- package/components/u-button/props.js +161 -0
- package/components/u-button/u-button.vue +495 -0
- package/components/u-button/vue.scss +80 -0
- package/components/u-calendar/header.vue +99 -0
- package/components/u-calendar/month.vue +579 -0
- package/components/u-calendar/props.js +144 -0
- package/components/u-calendar/u-calendar.vue +384 -0
- package/components/u-calendar/util.js +85 -0
- package/components/u-car-keyboard/props.js +14 -0
- package/components/u-car-keyboard/u-car-keyboard.vue +311 -0
- package/components/u-cell/props.js +110 -0
- package/components/u-cell/u-cell.vue +229 -0
- package/components/u-cell-group/props.js +14 -0
- package/components/u-cell-group/u-cell-group.vue +61 -0
- package/components/u-checkbox/props.js +69 -0
- package/components/u-checkbox/u-checkbox.vue +344 -0
- package/components/u-checkbox-group/props.js +82 -0
- package/components/u-checkbox-group/u-checkbox-group.vue +103 -0
- package/components/u-circle-progress/props.js +8 -0
- package/components/u-circle-progress/u-circle-progress.vue +198 -0
- package/components/u-code/props.js +34 -0
- package/components/u-code/u-code.vue +129 -0
- package/components/u-code-input/props.js +79 -0
- package/components/u-code-input/u-code-input.vue +252 -0
- package/components/u-col/props.js +29 -0
- package/components/u-col/u-col.vue +162 -0
- package/components/u-collapse/props.js +19 -0
- package/components/u-collapse/u-collapse.vue +90 -0
- package/components/u-collapse-item/props.js +59 -0
- package/components/u-collapse-item/u-collapse-item.vue +225 -0
- package/components/u-column-notice/props.js +55 -0
- package/components/u-column-notice/u-column-notice.vue +160 -0
- package/components/u-count-down/props.js +24 -0
- package/components/u-count-down/u-count-down.vue +163 -0
- package/components/u-count-down/utils.js +62 -0
- package/components/u-count-to/props.js +59 -0
- package/components/u-count-to/u-count-to.vue +184 -0
- package/components/u-datetime-picker/props.js +120 -0
- package/components/u-datetime-picker/u-datetime-picker.vue +361 -0
- package/components/u-divider/props.js +44 -0
- package/components/u-divider/u-divider.vue +116 -0
- package/components/u-dropdown/props.js +65 -0
- package/components/u-dropdown/u-dropdown.vue +127 -0
- package/components/u-dropdown-item/props.js +36 -0
- package/components/u-dropdown-item/u-dropdown-item.vue +127 -0
- package/components/u-empty/props.js +59 -0
- package/components/u-empty/u-empty.vue +128 -0
- package/components/u-form/props.js +45 -0
- package/components/u-form/u-form.vue +214 -0
- package/components/u-form-item/props.js +48 -0
- package/components/u-form-item/u-form-item.vue +235 -0
- package/components/u-gap/props.js +24 -0
- package/components/u-gap/u-gap.vue +38 -0
- package/components/u-grid/props.js +19 -0
- package/components/u-grid/u-grid.vue +97 -0
- package/components/u-grid-item/props.js +14 -0
- package/components/u-grid-item/u-grid-item.vue +209 -0
- package/components/u-icon/icons.js +214 -0
- package/components/u-icon/props.js +89 -0
- package/components/u-icon/u-icon.vue +237 -0
- package/components/u-image/props.js +84 -0
- package/components/u-image/u-image.vue +232 -0
- package/components/u-index-anchor/props.js +29 -0
- package/components/u-index-anchor/u-index-anchor.vue +91 -0
- package/components/u-index-item/props.js +5 -0
- package/components/u-index-item/u-index-item.vue +87 -0
- package/components/u-index-list/props.js +29 -0
- package/components/u-index-list/u-index-list.vue +440 -0
- package/components/u-input/props.js +187 -0
- package/components/u-input/u-input.vue +369 -0
- package/components/u-keyboard/props.js +84 -0
- package/components/u-keyboard/u-keyboard.vue +164 -0
- package/components/u-line/props.js +33 -0
- package/components/u-line/u-line.vue +62 -0
- package/components/u-line-progress/props.js +28 -0
- package/components/u-line-progress/u-line-progress.vue +144 -0
- package/components/u-link/props.js +39 -0
- package/components/u-link/u-link.vue +83 -0
- package/components/u-list/props.js +76 -0
- package/components/u-list/u-list.vue +157 -0
- package/components/u-list-item/props.js +9 -0
- package/components/u-list-item/u-list-item.vue +116 -0
- package/components/u-loading-icon/props.js +59 -0
- package/components/u-loading-icon/u-loading-icon.vue +343 -0
- package/components/u-loading-page/props.js +49 -0
- package/components/u-loading-page/u-loading-page.vue +115 -0
- package/components/u-loadmore/props.js +94 -0
- package/components/u-loadmore/u-loadmore.vue +150 -0
- package/components/u-modal/props.js +89 -0
- package/components/u-modal/u-modal.vue +228 -0
- package/components/u-navbar/props.js +84 -0
- package/components/u-navbar/u-navbar.vue +186 -0
- package/components/u-no-network/props.js +19 -0
- package/components/u-no-network/u-no-network.vue +220 -0
- package/components/u-notice-bar/props.js +70 -0
- package/components/u-notice-bar/u-notice-bar.vue +101 -0
- package/components/u-notify/props.js +49 -0
- package/components/u-notify/u-notify.vue +211 -0
- package/components/u-number-box/props.js +109 -0
- package/components/u-number-box/u-number-box.vue +416 -0
- package/components/u-number-keyboard/props.js +19 -0
- package/components/u-number-keyboard/u-number-keyboard.vue +196 -0
- package/components/u-overlay/props.js +24 -0
- package/components/u-overlay/u-overlay.vue +68 -0
- package/components/u-parse/node/node.vue +499 -0
- package/components/u-parse/parser.js +1075 -0
- package/components/u-parse/props.js +45 -0
- package/components/u-parse/u-parse.vue +366 -0
- package/components/u-picker/props.js +79 -0
- package/components/u-picker/u-picker.vue +286 -0
- package/components/u-picker-column/props.js +5 -0
- package/components/u-picker-column/u-picker-column.vue +27 -0
- package/components/u-popup/props.js +79 -0
- package/components/u-popup/u-popup.vue +304 -0
- package/components/u-radio/props.js +64 -0
- package/components/u-radio/u-radio.vue +339 -0
- package/components/u-radio-group/props.js +85 -0
- package/components/u-radio-group/u-radio-group.vue +108 -0
- package/components/u-rate/props.js +69 -0
- package/components/u-rate/u-rate.vue +306 -0
- package/components/u-read-more/props.js +61 -0
- package/components/u-read-more/u-read-more.vue +157 -0
- package/components/u-row/props.js +19 -0
- package/components/u-row/u-row.vue +93 -0
- package/components/u-row-notice/props.js +39 -0
- package/components/u-row-notice/u-row-notice.vue +330 -0
- package/components/u-safe-bottom/props.js +5 -0
- package/components/u-safe-bottom/u-safe-bottom.vue +56 -0
- package/components/u-scroll-list/nvue.js +28 -0
- package/components/u-scroll-list/other.js +0 -0
- package/components/u-scroll-list/props.js +34 -0
- package/components/u-scroll-list/scrollWxs.wxs +50 -0
- package/components/u-scroll-list/u-scroll-list.vue +224 -0
- package/components/u-search/props.js +118 -0
- package/components/u-search/u-search.vue +303 -0
- package/components/u-skeleton/props.js +59 -0
- package/components/u-skeleton/u-skeleton.vue +244 -0
- package/components/u-slider/mpother.js +113 -0
- package/components/u-slider/mpwxs.js +42 -0
- package/components/u-slider/mpwxs.wxs +121 -0
- package/components/u-slider/nvue - /345/211/257/346/234/254.js" +180 -0
- package/components/u-slider/nvue.js +193 -0
- package/components/u-slider/props.js +54 -0
- package/components/u-slider/u-slider.vue +55 -0
- package/components/u-status-bar/props.js +8 -0
- package/components/u-status-bar/u-status-bar.vue +46 -0
- package/components/u-steps/props.js +39 -0
- package/components/u-steps/u-steps.vue +80 -0
- package/components/u-steps-item/props.js +24 -0
- package/components/u-steps-item/u-steps-item.vue +316 -0
- package/components/u-sticky/props.js +40 -0
- package/components/u-sticky/u-sticky.vue +212 -0
- package/components/u-subsection/props.js +49 -0
- package/components/u-subsection/u-subsection.vue +299 -0
- package/components/u-swipe-action/props.js +9 -0
- package/components/u-swipe-action/u-swipe-action.vue +67 -0
- package/components/u-swipe-action-item/index - backup.wxs +256 -0
- package/components/u-swipe-action-item/index.wxs +225 -0
- package/components/u-swipe-action-item/nvue - backup.js +270 -0
- package/components/u-swipe-action-item/nvue.js +174 -0
- package/components/u-swipe-action-item/props.js +41 -0
- package/components/u-swipe-action-item/u-swipe-action-item.vue +190 -0
- package/components/u-swipe-action-item/wxs.js +15 -0
- package/components/u-swiper/props.js +125 -0
- package/components/u-swiper/u-swiper.vue +255 -0
- package/components/u-swiper-indicator/props.js +29 -0
- package/components/u-swiper-indicator/u-swiper-indicator.vue +110 -0
- package/components/u-switch/props.js +54 -0
- package/components/u-switch/u-switch.vue +177 -0
- package/components/u-tabbar/props.js +44 -0
- package/components/u-tabbar/u-tabbar.vue +141 -0
- package/components/u-tabbar-item/props.js +35 -0
- package/components/u-tabbar-item/u-tabbar-item.vue +142 -0
- package/components/u-table/props.js +5 -0
- package/components/u-table/u-table.vue +29 -0
- package/components/u-tabs/props.js +64 -0
- package/components/u-tabs/u-tabs.vue +363 -0
- package/components/u-tabs-item/props.js +5 -0
- package/components/u-tabs-item/u-tabs-item.vue +29 -0
- package/components/u-tag/props.js +84 -0
- package/components/u-tag/u-tag.vue +358 -0
- package/components/u-td/props.js +5 -0
- package/components/u-td/u-td.vue +31 -0
- package/components/u-text/props.js +110 -0
- package/components/u-text/u-text.vue +223 -0
- package/components/u-text/value.js +85 -0
- package/components/u-textarea/props.js +119 -0
- package/components/u-textarea/u-textarea.vue +239 -0
- package/components/u-toast/u-toast.vue +291 -0
- package/components/u-toolbar/props.js +34 -0
- package/components/u-toolbar/u-toolbar.vue +102 -0
- package/components/u-tooltip/clipboard.min.js +58 -0
- package/components/u-tooltip/props.js +59 -0
- package/components/u-tooltip/u-tooltip.vue +366 -0
- package/components/u-tr/props.js +5 -0
- package/components/u-tr/u-tr.vue +31 -0
- package/components/u-transition/nvue.ani-map.js +68 -0
- package/components/u-transition/props.js +24 -0
- package/components/u-transition/transition.js +157 -0
- package/components/u-transition/u-transition.vue +92 -0
- package/components/u-transition/vue.ani-style.scss +113 -0
- package/components/u-upload/mixin.js +21 -0
- package/components/u-upload/props.js +124 -0
- package/components/u-upload/u-upload.vue +566 -0
- package/components/u-upload/utils.js +151 -0
- package/components/uview-ui/uview-ui.vue +15 -0
- package/index.js +79 -0
- package/index.scss +23 -0
- package/libs/config/color.js +17 -0
- package/libs/config/config.js +34 -0
- package/libs/config/props/actionSheet.js +25 -0
- package/libs/config/props/album.js +25 -0
- package/libs/config/props/alert.js +22 -0
- package/libs/config/props/avatar.js +28 -0
- package/libs/config/props/avatarGroup.js +23 -0
- package/libs/config/props/backtop.js +27 -0
- package/libs/config/props/badge.js +27 -0
- package/libs/config/props/button.js +42 -0
- package/libs/config/props/calendar.js +42 -0
- package/libs/config/props/carKeyboard.js +15 -0
- package/libs/config/props/cell.js +35 -0
- package/libs/config/props/cellGroup.js +17 -0
- package/libs/config/props/checkbox.js +27 -0
- package/libs/config/props/checkboxGroup.js +29 -0
- package/libs/config/props/circleProgress.js +15 -0
- package/libs/config/props/code.js +21 -0
- package/libs/config/props/codeInput.js +29 -0
- package/libs/config/props/col.js +19 -0
- package/libs/config/props/collapse.js +17 -0
- package/libs/config/props/collapseItem.js +25 -0
- package/libs/config/props/columnNotice.js +24 -0
- package/libs/config/props/countDown.js +18 -0
- package/libs/config/props/countTo.js +25 -0
- package/libs/config/props/datetimePicker.js +37 -0
- package/libs/config/props/divider.js +23 -0
- package/libs/config/props/empty.js +26 -0
- package/libs/config/props/form.js +22 -0
- package/libs/config/props/formItem.js +23 -0
- package/libs/config/props/gap.js +19 -0
- package/libs/config/props/grid.js +17 -0
- package/libs/config/props/gridItem.js +16 -0
- package/libs/config/props/icon.js +36 -0
- package/libs/config/props/image.js +30 -0
- package/libs/config/props/indexAnchor.js +19 -0
- package/libs/config/props/indexList.js +19 -0
- package/libs/config/props/input.js +48 -0
- package/libs/config/props/keyboard.js +30 -0
- package/libs/config/props/line.js +20 -0
- package/libs/config/props/lineProgress.js +19 -0
- package/libs/config/props/link.js +26 -0
- package/libs/config/props/list.js +28 -0
- package/libs/config/props/listItem.js +15 -0
- package/libs/config/props/loadingIcon.js +30 -0
- package/libs/config/props/loadingPage.js +23 -0
- package/libs/config/props/loadmore.js +32 -0
- package/libs/config/props/modal.js +31 -0
- package/libs/config/props/navbar.js +32 -0
- package/libs/config/props/noNetwork.js +18 -0
- package/libs/config/props/noticeBar.js +27 -0
- package/libs/config/props/notify.js +22 -0
- package/libs/config/props/numberBox.js +35 -0
- package/libs/config/props/numberKeyboard.js +17 -0
- package/libs/config/props/overlay.js +18 -0
- package/libs/config/props/parse.js +22 -0
- package/libs/config/props/picker.js +29 -0
- package/libs/config/props/popup.js +29 -0
- package/libs/config/props/radio.js +27 -0
- package/libs/config/props/radioGroup.js +30 -0
- package/libs/config/props/rate.js +26 -0
- package/libs/config/props/readMore.js +22 -0
- package/libs/config/props/row.js +17 -0
- package/libs/config/props/rowNotice.js +21 -0
- package/libs/config/props/scrollList.js +20 -0
- package/libs/config/props/search.js +37 -0
- package/libs/config/props/section.js +24 -0
- package/libs/config/props/skeleton.js +25 -0
- package/libs/config/props/slider.js +25 -0
- package/libs/config/props/statusBar.js +15 -0
- package/libs/config/props/steps.js +21 -0
- package/libs/config/props/stepsItem.js +18 -0
- package/libs/config/props/sticky.js +20 -0
- package/libs/config/props/subsection.js +23 -0
- package/libs/config/props/swipeAction.js +15 -0
- package/libs/config/props/swipeActionItem.js +21 -0
- package/libs/config/props/swiper.js +39 -0
- package/libs/config/props/swipterIndicator.js +19 -0
- package/libs/config/props/switch.js +24 -0
- package/libs/config/props/tabbar.js +22 -0
- package/libs/config/props/tabbarItem.js +20 -0
- package/libs/config/props/tabs.js +32 -0
- package/libs/config/props/tag.js +29 -0
- package/libs/config/props/text.js +38 -0
- package/libs/config/props/textarea.js +36 -0
- package/libs/config/props/toast.js +30 -0
- package/libs/config/props/toolbar.js +21 -0
- package/libs/config/props/tooltip.js +25 -0
- package/libs/config/props/transition.js +18 -0
- package/libs/config/props/upload.js +36 -0
- package/libs/config/props.js +190 -0
- package/libs/config/zIndex.js +20 -0
- package/libs/css/color.scss +155 -0
- package/libs/css/common.scss +97 -0
- package/libs/css/components.scss +15 -0
- package/libs/css/flex.scss +257 -0
- package/libs/css/h5.scss +0 -0
- package/libs/css/mixin.scss +8 -0
- package/libs/css/mp.scss +0 -0
- package/libs/css/nvue.scss +0 -0
- package/libs/css/vue.scss +27 -0
- package/libs/function/colorGradient.js +134 -0
- package/libs/function/debounce.js +29 -0
- package/libs/function/digit.js +167 -0
- package/libs/function/index.js +731 -0
- package/libs/function/platform.js +75 -0
- package/libs/function/test.js +288 -0
- package/libs/function/throttle.js +30 -0
- package/libs/luch-request/adapters/index.js +97 -0
- package/libs/luch-request/core/InterceptorManager.js +50 -0
- package/libs/luch-request/core/Request.js +198 -0
- package/libs/luch-request/core/buildFullPath.js +20 -0
- package/libs/luch-request/core/defaults.js +29 -0
- package/libs/luch-request/core/dispatchRequest.js +3 -0
- package/libs/luch-request/core/mergeConfig.js +103 -0
- package/libs/luch-request/core/settle.js +16 -0
- package/libs/luch-request/helpers/buildURL.js +69 -0
- package/libs/luch-request/helpers/combineURLs.js +14 -0
- package/libs/luch-request/helpers/isAbsoluteURL.js +14 -0
- package/libs/luch-request/index.d.ts +116 -0
- package/libs/luch-request/index.js +3 -0
- package/libs/luch-request/utils/clone.js +264 -0
- package/libs/luch-request/utils.js +131 -0
- package/libs/mixin/button.js +13 -0
- package/libs/mixin/mixin.js +160 -0
- package/libs/mixin/mpMixin.js +8 -0
- package/libs/mixin/mpShare.js +13 -0
- package/libs/mixin/openType.js +25 -0
- package/libs/mixin/style.js +228 -0
- package/libs/mixin/touch.js +59 -0
- package/libs/util/async-validator.js +1343 -0
- package/libs/util/calendar.js +546 -0
- package/libs/util/dayjs.js +308 -0
- package/libs/util/emitter.js +51 -0
- package/libs/util/route.js +124 -0
- package/package.json +83 -0
- package/theme.scss +44 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<text
|
|
3
|
+
v-if="show && ((Number(value) === 0 ? showZero : true) || isDot)"
|
|
4
|
+
:class="[isDot ? 'u-badge--dot' : 'u-badge--not-dot', inverted && 'u-badge--inverted', shape === 'horn' && 'u-badge--horn', `u-badge--${type}${inverted ? '--inverted' : ''}`]"
|
|
5
|
+
:style="[$u.addStyle(customStyle), badgeStyle]"
|
|
6
|
+
class="u-badge"
|
|
7
|
+
>{{ isDot ? '' :showValue }}</text>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import props from './props.js';
|
|
12
|
+
/**
|
|
13
|
+
* badge 徽标数
|
|
14
|
+
* @description 该组件一般用于图标右上角显示未读的消息数量,提示用户点击,有圆点和圆包含文字两种形式。
|
|
15
|
+
* @tutorial https://uviewui.com/components/badge.html
|
|
16
|
+
*
|
|
17
|
+
* @property {Boolean} isDot 是否显示圆点 (默认 false )
|
|
18
|
+
* @property {String | Number} value 显示的内容
|
|
19
|
+
* @property {Boolean} show 是否显示 (默认 true )
|
|
20
|
+
* @property {String | Number} max 最大值,超过最大值会显示 '{max}+' (默认999)
|
|
21
|
+
* @property {String} type 主题类型,error|warning|success|primary (默认 'error' )
|
|
22
|
+
* @property {Boolean} showZero 当数值为 0 时,是否展示 Badge (默认 false )
|
|
23
|
+
* @property {String} bgColor 背景颜色,优先级比type高,如设置,type参数会失效
|
|
24
|
+
* @property {String} color 字体颜色 (默认 '#ffffff' )
|
|
25
|
+
* @property {String} shape 徽标形状,circle-四角均为圆角,horn-左下角为直角 (默认 'circle' )
|
|
26
|
+
* @property {String} numberType 设置数字的显示方式,overflow|ellipsis|limit (默认 'overflow' )
|
|
27
|
+
* @property {Array}} offset 设置badge的位置偏移,格式为 [x, y],也即设置的为top和right的值,absolute为true时有效
|
|
28
|
+
* @property {Boolean} inverted 是否反转背景和字体颜色(默认 false )
|
|
29
|
+
* @property {Boolean} absolute 是否绝对定位(默认 false )
|
|
30
|
+
* @property {Object} customStyle 定义需要用到的外部样式
|
|
31
|
+
* @example <u-badge :type="type" :count="count"></u-badge>
|
|
32
|
+
*/
|
|
33
|
+
export default {
|
|
34
|
+
name: 'u-badge',
|
|
35
|
+
mixins: [uni.$u.mpMixin, props, uni.$u.mixin],
|
|
36
|
+
computed: {
|
|
37
|
+
// 是否将badge中心与父组件右上角重合
|
|
38
|
+
boxStyle() {
|
|
39
|
+
let style = {};
|
|
40
|
+
return style;
|
|
41
|
+
},
|
|
42
|
+
// 整个组件的样式
|
|
43
|
+
badgeStyle() {
|
|
44
|
+
const style = {}
|
|
45
|
+
if(this.color) {
|
|
46
|
+
style.color = this.color
|
|
47
|
+
}
|
|
48
|
+
if (this.bgColor && !this.inverted) {
|
|
49
|
+
style.backgroundColor = this.bgColor
|
|
50
|
+
}
|
|
51
|
+
if (this.absolute) {
|
|
52
|
+
style.position = 'absolute'
|
|
53
|
+
// 如果有设置offset参数
|
|
54
|
+
if(this.offset.length) {
|
|
55
|
+
// top和right分为为offset的第一个和第二个值,如果没有第二个值,则right等于top
|
|
56
|
+
const top = this.offset[0]
|
|
57
|
+
const right = this.offset[1] || top
|
|
58
|
+
style.top = uni.$u.addUnit(top)
|
|
59
|
+
style.right = uni.$u.addUnit(right)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return style
|
|
63
|
+
},
|
|
64
|
+
showValue() {
|
|
65
|
+
switch (this.numberType) {
|
|
66
|
+
case "overflow":
|
|
67
|
+
return Number(this.value) > Number(this.max) ? this.max + "+" : this.value
|
|
68
|
+
break;
|
|
69
|
+
case "ellipsis":
|
|
70
|
+
return Number(this.value) > Number(this.max) ? "..." : this.value
|
|
71
|
+
break;
|
|
72
|
+
case "limit":
|
|
73
|
+
return Number(this.value) > 999 ? Number(this.value) >= 9999 ?
|
|
74
|
+
Math.floor(this.value / 1e4 * 100) / 100 + "w" : Math.floor(this.value /
|
|
75
|
+
1e3 * 100) / 100 + "k" : this.value
|
|
76
|
+
break;
|
|
77
|
+
default:
|
|
78
|
+
return Number(this.value)
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style lang="scss" scoped>
|
|
86
|
+
@import "../../libs/css/components.scss";
|
|
87
|
+
|
|
88
|
+
$u-badge-primary: $u-primary !default;
|
|
89
|
+
$u-badge-error: $u-error !default;
|
|
90
|
+
$u-badge-success: $u-success !default;
|
|
91
|
+
$u-badge-info: $u-info !default;
|
|
92
|
+
$u-badge-warning: $u-warning !default;
|
|
93
|
+
$u-badge-dot-radius: 100px !default;
|
|
94
|
+
$u-badge-dot-size: 8px !default;
|
|
95
|
+
$u-badge-dot-right: 4px !default;
|
|
96
|
+
$u-badge-dot-top: 0 !default;
|
|
97
|
+
$u-badge-text-font-size: 11px !default;
|
|
98
|
+
$u-badge-text-right: 10px !default;
|
|
99
|
+
$u-badge-text-padding: 2px 5px !default;
|
|
100
|
+
$u-badge-text-align: center !default;
|
|
101
|
+
$u-badge-text-color: #FFFFFF !default;
|
|
102
|
+
|
|
103
|
+
.u-badge {
|
|
104
|
+
border-top-right-radius: $u-badge-dot-radius;
|
|
105
|
+
border-top-left-radius: $u-badge-dot-radius;
|
|
106
|
+
border-bottom-left-radius: $u-badge-dot-radius;
|
|
107
|
+
border-bottom-right-radius: $u-badge-dot-radius;
|
|
108
|
+
@include flex;
|
|
109
|
+
line-height: $u-badge-text-font-size;
|
|
110
|
+
text-align: $u-badge-text-align;
|
|
111
|
+
font-size: $u-badge-text-font-size;
|
|
112
|
+
color: $u-badge-text-color;
|
|
113
|
+
|
|
114
|
+
&--dot {
|
|
115
|
+
height: $u-badge-dot-size;
|
|
116
|
+
width: $u-badge-dot-size;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&--inverted {
|
|
120
|
+
font-size: 13px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&--not-dot {
|
|
124
|
+
padding: $u-badge-text-padding;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&--horn {
|
|
128
|
+
border-bottom-left-radius: 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&--primary {
|
|
132
|
+
background-color: $u-badge-primary;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&--primary--inverted {
|
|
136
|
+
color: $u-badge-primary;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&--error {
|
|
140
|
+
background-color: $u-badge-error;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&--error--inverted {
|
|
144
|
+
color: $u-badge-error;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&--success {
|
|
148
|
+
background-color: $u-badge-success;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&--success--inverted {
|
|
152
|
+
color: $u-badge-success;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&--info {
|
|
156
|
+
background-color: $u-badge-info;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&--info--inverted {
|
|
160
|
+
color: $u-badge-info;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&--warning {
|
|
164
|
+
background-color: $u-badge-warning;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&--warning--inverted {
|
|
168
|
+
color: $u-badge-warning;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
$u-button-active-opacity:0.75 !default;
|
|
2
|
+
$u-button-loading-text-margin-left:4px !default;
|
|
3
|
+
$u-button-text-color: #FFFFFF !default;
|
|
4
|
+
$u-button-text-plain-error-color:$u-error !default;
|
|
5
|
+
$u-button-text-plain-warning-color:$u-warning !default;
|
|
6
|
+
$u-button-text-plain-success-color:$u-success !default;
|
|
7
|
+
$u-button-text-plain-info-color:$u-info !default;
|
|
8
|
+
$u-button-text-plain-primary-color:$u-primary !default;
|
|
9
|
+
.u-button {
|
|
10
|
+
&--active {
|
|
11
|
+
opacity: $u-button-active-opacity;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&--active--plain {
|
|
15
|
+
background-color: rgb(217, 217, 217);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&__loading-text {
|
|
19
|
+
margin-left:$u-button-loading-text-margin-left;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__text,
|
|
23
|
+
&__loading-text {
|
|
24
|
+
color:$u-button-text-color;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&__text--plain--error {
|
|
28
|
+
color:$u-button-text-plain-error-color;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&__text--plain--warning {
|
|
32
|
+
color:$u-button-text-plain-warning-color;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&__text--plain--success{
|
|
36
|
+
color:$u-button-text-plain-success-color;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&__text--plain--info {
|
|
40
|
+
color:$u-button-text-plain-info-color;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__text--plain--primary {
|
|
44
|
+
color:$u-button-text-plain-primary-color;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author : LQ
|
|
3
|
+
* @Description :
|
|
4
|
+
* @version : 1.0
|
|
5
|
+
* @Date : 2021-08-16 10:04:04
|
|
6
|
+
* @LastAuthor : LQ
|
|
7
|
+
* @lastTime : 2021-08-16 10:04:24
|
|
8
|
+
* @FilePath : /u-view2.0/uview-ui/components/u-button/props.js
|
|
9
|
+
*/
|
|
10
|
+
export default {
|
|
11
|
+
props: {
|
|
12
|
+
// 是否细边框
|
|
13
|
+
hairline: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: uni.$u.props.button.hairline
|
|
16
|
+
},
|
|
17
|
+
// 按钮的预置样式,info,primary,error,warning,success
|
|
18
|
+
type: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: uni.$u.props.button.type
|
|
21
|
+
},
|
|
22
|
+
// 按钮尺寸,large,normal,small,mini
|
|
23
|
+
size: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: uni.$u.props.button.size
|
|
26
|
+
},
|
|
27
|
+
// 按钮形状,circle(两边为半圆),square(带圆角)
|
|
28
|
+
shape: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: uni.$u.props.button.shape
|
|
31
|
+
},
|
|
32
|
+
// 按钮是否镂空
|
|
33
|
+
plain: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: uni.$u.props.button.plain
|
|
36
|
+
},
|
|
37
|
+
// 是否禁止状态
|
|
38
|
+
disabled: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: uni.$u.props.button.disabled
|
|
41
|
+
},
|
|
42
|
+
// 是否加载中
|
|
43
|
+
loading: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: uni.$u.props.button.loading
|
|
46
|
+
},
|
|
47
|
+
// 加载中提示文字
|
|
48
|
+
loadingText: {
|
|
49
|
+
type: [String, Number],
|
|
50
|
+
default: uni.$u.props.button.loadingText
|
|
51
|
+
},
|
|
52
|
+
// 加载状态图标类型
|
|
53
|
+
loadingMode: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: uni.$u.props.button.loadingMode
|
|
56
|
+
},
|
|
57
|
+
// 加载图标大小
|
|
58
|
+
loadingSize: {
|
|
59
|
+
type: [String, Number],
|
|
60
|
+
default: uni.$u.props.button.loadingSize
|
|
61
|
+
},
|
|
62
|
+
// 开放能力,具体请看uniapp稳定关于button组件部分说明
|
|
63
|
+
// https://uniapp.dcloud.io/component/button
|
|
64
|
+
openType: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: uni.$u.props.button.openType
|
|
67
|
+
},
|
|
68
|
+
// 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
|
|
69
|
+
// 取值为submit(提交表单),reset(重置表单)
|
|
70
|
+
formType: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: uni.$u.props.button.formType
|
|
73
|
+
},
|
|
74
|
+
// 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
|
|
75
|
+
// 只微信小程序、QQ小程序有效
|
|
76
|
+
appParameter: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: uni.$u.props.button.appParameter
|
|
79
|
+
},
|
|
80
|
+
// 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
|
|
81
|
+
hoverStopPropagation: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: uni.$u.props.button.hoverStopPropagation
|
|
84
|
+
},
|
|
85
|
+
// 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效
|
|
86
|
+
lang: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: uni.$u.props.button.lang
|
|
89
|
+
},
|
|
90
|
+
// 会话来源,open-type="contact"时有效。只微信小程序有效
|
|
91
|
+
sessionFrom: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: uni.$u.props.button.sessionFrom
|
|
94
|
+
},
|
|
95
|
+
// 会话内消息卡片标题,open-type="contact"时有效
|
|
96
|
+
// 默认当前标题,只微信小程序有效
|
|
97
|
+
sendMessageTitle: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: uni.$u.props.button.sendMessageTitle
|
|
100
|
+
},
|
|
101
|
+
// 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效
|
|
102
|
+
// 默认当前分享路径,只微信小程序有效
|
|
103
|
+
sendMessagePath: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: uni.$u.props.button.sendMessagePath
|
|
106
|
+
},
|
|
107
|
+
// 会话内消息卡片图片,open-type="contact"时有效
|
|
108
|
+
// 默认当前页面截图,只微信小程序有效
|
|
109
|
+
sendMessageImg: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: uni.$u.props.button.sendMessageImg
|
|
112
|
+
},
|
|
113
|
+
// 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,
|
|
114
|
+
// 用户点击后可以快速发送小程序消息,open-type="contact"时有效
|
|
115
|
+
showMessageCard: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: uni.$u.props.button.showMessageCard
|
|
118
|
+
},
|
|
119
|
+
// 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
|
|
120
|
+
dataName: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: uni.$u.props.button.dataName
|
|
123
|
+
},
|
|
124
|
+
// 节流,一定时间内只能触发一次
|
|
125
|
+
throttleTime: {
|
|
126
|
+
type: [String, Number],
|
|
127
|
+
default: uni.$u.props.button.throttleTime
|
|
128
|
+
},
|
|
129
|
+
// 按住后多久出现点击态,单位毫秒
|
|
130
|
+
hoverStartTime: {
|
|
131
|
+
type: [String, Number],
|
|
132
|
+
default: uni.$u.props.button.hoverStartTime
|
|
133
|
+
},
|
|
134
|
+
// 手指松开后点击态保留时间,单位毫秒
|
|
135
|
+
hoverStayTime: {
|
|
136
|
+
type: [String, Number],
|
|
137
|
+
default: uni.$u.props.button.hoverStayTime
|
|
138
|
+
},
|
|
139
|
+
// 按钮文字,之所以通过props传入,是因为slot传入的话
|
|
140
|
+
// nvue中无法控制文字的样式
|
|
141
|
+
text: {
|
|
142
|
+
type: [String, Number],
|
|
143
|
+
default: uni.$u.props.button.text
|
|
144
|
+
},
|
|
145
|
+
// 按钮图标
|
|
146
|
+
icon: {
|
|
147
|
+
type: String,
|
|
148
|
+
default: uni.$u.props.button.icon
|
|
149
|
+
},
|
|
150
|
+
// 按钮图标
|
|
151
|
+
iconColor: {
|
|
152
|
+
type: String,
|
|
153
|
+
default: uni.$u.props.button.icon
|
|
154
|
+
},
|
|
155
|
+
// 按钮颜色,支持传入linear-gradient渐变色
|
|
156
|
+
color: {
|
|
157
|
+
type: String,
|
|
158
|
+
default: uni.$u.props.button.color
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|