@10yun/cv-mobile-ui 0.5.29 → 0.5.30
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/package.json +1 -1
- package/plugins/luch-request/adapters/index.js +131 -0
- package/plugins/luch-request/core/InterceptorManager.js +50 -0
- package/plugins/luch-request/core/Request.js +199 -0
- package/plugins/luch-request/core/buildFullPath.js +20 -0
- package/plugins/luch-request/core/defaults.js +32 -0
- package/plugins/luch-request/core/dispatchRequest.js +5 -0
- package/plugins/luch-request/core/mergeConfig.js +125 -0
- package/plugins/luch-request/core/settle.js +16 -0
- package/plugins/luch-request/helpers/buildURL.js +71 -0
- package/plugins/luch-request/helpers/combineURLs.js +12 -0
- package/plugins/luch-request/helpers/isAbsoluteURL.js +14 -0
- package/plugins/luch-request/index.d.ts +197 -0
- package/plugins/luch-request/index.js +2 -0
- package/plugins/luch-request/readme.md +3 -0
- package/plugins/luch-request/utils/clone.js +264 -0
- package/plugins/luch-request/utils.js +131 -0
- package/plugins/request.js +2 -2
- package/ui-cv/components/cv-form-item/cv-form-item.vue +1 -1
- package/ui-fireui/fui-actionsheet/fui-actionsheet.vue +202 -0
- package/ui-fireui/fui-alert/fui-alert.vue +141 -0
- package/ui-fireui/fui-badge/fui-badge.vue +158 -0
- package/ui-fireui/fui-bottom-navigation/fui-bottom-navigation.vue +390 -0
- package/ui-fireui/fui-bottom-popup/fui-bottom-popup.vue +100 -0
- package/ui-fireui/fui-bubble-popup/fui-bubble-popup.vue +236 -0
- package/ui-fireui/fui-button/fui-button.vue +424 -0
- package/ui-fireui/fui-calendar/fui-calendar.js +915 -0
- package/ui-fireui/fui-calendar/fui-calendar.vue +868 -0
- package/ui-fireui/fui-card/fui-card.vue +231 -0
- package/ui-fireui/fui-cascade-selection/fui-cascade-selection.vue +538 -0
- package/ui-fireui/fui-circular-progress/fui-circular-progress.vue +261 -0
- package/ui-fireui/fui-collapse/fui-collapse.vue +179 -0
- package/ui-fireui/fui-countdown/fui-countdown.vue +301 -0
- package/ui-fireui/fui-datetime/fui-datetime.vue +570 -0
- package/ui-fireui/fui-divider/fui-divider.vue +118 -0
- package/ui-fireui/fui-drawer/fui-drawer.vue +103 -0
- package/ui-fireui/fui-dropdown-list/fui-dropdown-list.vue +70 -0
- package/ui-fireui/fui-fab/fui-fab.vue +284 -0
- package/ui-fireui/fui-footer/fui-footer.vue +131 -0
- package/ui-fireui/fui-grid/fui-grid.vue +42 -0
- package/ui-fireui/fui-grid-item/fui-grid-item.vue +142 -0
- package/ui-fireui/fui-icon/fui-icon.vue +820 -0
- package/ui-fireui/fui-image-cropper/fui-image-cropper.vue +1058 -0
- package/ui-fireui/fui-image-group/fui-image-group.vue +149 -0
- package/ui-fireui/fui-keyboard/fui-keyboard.vue +254 -0
- package/ui-fireui/fui-keyboard-input/fui-keyboard-input.vue +78 -0
- package/ui-fireui/fui-list-cell/fui-list-cell.vue +178 -0
- package/ui-fireui/fui-list-view/fui-list-view.vue +87 -0
- package/ui-fireui/fui-loading/fui-loading.vue +78 -0
- package/ui-fireui/fui-loadmore/fui-loadmore.vue +163 -0
- package/ui-fireui/fui-modal/fui-modal.vue +392 -0
- package/ui-fireui/fui-navigation-bar/fui-navigation-bar.vue +180 -0
- package/ui-fireui/fui-no-data/fui-no-data.vue +116 -0
- package/ui-fireui/fui-nomore/fui-nomore.vue +116 -0
- package/ui-fireui/fui-numberbox/fui-numberbox.vue +234 -0
- package/ui-fireui/fui-numberbox-border/fui-numberbox-border.vue +232 -0
- package/ui-fireui/fui-picture-cropper/fui-picture-cropper.vue +682 -0
- package/ui-fireui/fui-picture-cropper/fui-picture-cropper.wxs +560 -0
- package/ui-fireui/fui-rate/fui-rate.vue +167 -0
- package/ui-fireui/fui-round-progress/fui-round-progress.vue +306 -0
- package/ui-fireui/fui-scroll-top/fui-scroll-top.vue +189 -0
- package/ui-fireui/fui-sharemodel/fui-sharemodel.vue +181 -0
- package/ui-fireui/fui-skeleton/fui-skeleton.vue +248 -0
- package/ui-fireui/fui-steps/fui-steps.vue +214 -0
- package/ui-fireui/fui-sticky/fui-sticky.vue +155 -0
- package/ui-fireui/fui-sticky-wxs/fui-sticky-wxs.vue +133 -0
- package/ui-fireui/fui-sticky-wxs/fui-sticky.wxs +44 -0
- package/ui-fireui/fui-swipe-action/fui-swipe-action.vue +301 -0
- package/ui-fireui/fui-tabbar/fui-tabbar.vue +283 -0
- package/ui-fireui/fui-tabs/fui-tabs.vue +284 -0
- package/ui-fireui/fui-tabs2/fui-tabs2.vue +284 -0
- package/ui-fireui/fui-tag/fui-tag.vue +374 -0
- package/ui-fireui/fui-time-axis/fui-time-axis.vue +36 -0
- package/ui-fireui/fui-timeaxis-item/fui-timeaxis-item.vue +48 -0
- package/ui-fireui/fui-tips/fui-tips.vue +161 -0
- package/ui-fireui/fui-toast/fui-toast.vue +117 -0
- package/ui-fireui/fui-top-dropdown/fui-top-dropdown.vue +129 -0
- package/ui-fireui/fui-upload/fui-upload.vue +446 -0
- package/ui-fireui/fui-uploadsamll/fui-uploadsamll.vue +472 -0
- package/uview-plus/README.md +1 -1
- package/uview-plus/changelog-wu-tool.md +21 -0
- package/uview-plus/changelog-wu.md +91 -0
- package/uview-plus/components/u-action-sheet/_doc/changelog.md +12 -0
- package/uview-plus/components/u-action-sheet/_doc/package.json +92 -0
- package/uview-plus/components/u-action-sheet/_doc/readme.md +16 -0
- package/uview-plus/components/u-app-update/_doc/changelog.md +26 -0
- package/uview-plus/components/u-app-update/_doc/package.json +89 -0
- package/uview-plus/components/u-app-update/_doc/readme.md +16 -0
- package/uview-plus/components/u-app-update/config.js +120 -0
- package/uview-plus/components/u-app-update/img/act.png +0 -0
- package/uview-plus/components/u-app-update/img/appUploadAlertBoxBg.png +0 -0
- package/uview-plus/components/u-app-update/img/close.png +0 -0
- package/uview-plus/components/u-app-update/js-sdk/checkVersion.js +81 -0
- package/uview-plus/components/u-app-update/js-sdk/silentlyAppUpdate.js +41 -0
- package/uview-plus/components/u-app-update/pages/index.vue +8 -0
- package/uview-plus/components/u-app-update/u-app-update.vue +583 -0
- package/uview-plus/components/u-button-wu/_doc/changelog.md +6 -0
- package/uview-plus/components/u-button-wu/_doc/package.json +89 -0
- package/uview-plus/components/u-button-wu/_doc/readme.md +16 -0
- package/uview-plus/components/u-button-wu/u-button-wu.vue +522 -0
- package/uview-plus/components/u-button-wu/vue.scss +81 -0
- package/uview-plus/components/u-calendar-wu/_doc/changelog.md +145 -0
- package/uview-plus/components/u-calendar-wu/_doc/package.json +90 -0
- package/uview-plus/components/u-calendar-wu/_doc/readme.md +16 -0
- package/uview-plus/components/u-calendar-wu/calendar.js +664 -0
- package/uview-plus/components/u-calendar-wu/i18n/en.json +14 -0
- package/uview-plus/components/u-calendar-wu/i18n/index.js +8 -0
- package/uview-plus/components/u-calendar-wu/i18n/zh-Hans.json +14 -0
- package/uview-plus/components/u-calendar-wu/i18n/zh-Hant.json +14 -0
- package/uview-plus/components/u-calendar-wu/props.js +166 -0
- package/uview-plus/components/u-calendar-wu/style.css +196 -0
- package/uview-plus/components/u-calendar-wu/u-calendar-wu.vue +921 -0
- package/uview-plus/components/u-calendar-wu/util.js +552 -0
- package/uview-plus/components/u-calendar-wu/wu-calendar-block/props.js +73 -0
- package/uview-plus/components/u-calendar-wu/wu-calendar-block/wu-calendar-block.vue +122 -0
- package/uview-plus/components/u-calendar-wu/wu-calendar-item/props.js +55 -0
- package/uview-plus/components/u-calendar-wu/wu-calendar-item/wu-calendar-item.vue +293 -0
- package/uview-plus/components/u-cell/_doc/changelog.md +6 -0
- package/uview-plus/components/u-cell/_doc/package.json +89 -0
- package/uview-plus/components/u-cell/_doc/readme.md +25 -0
- package/uview-plus/components/u-checkbox/_doc/changelog.md +8 -0
- package/uview-plus/components/u-checkbox/_doc/package.json +88 -0
- package/uview-plus/components/u-checkbox/_doc/readme.md +25 -0
- package/uview-plus/components/u-code/_doc/changelog.md +6 -0
- package/uview-plus/components/u-code/_doc/package.json +86 -0
- package/uview-plus/components/u-code/_doc/readme.md +16 -0
- package/uview-plus/components/u-drag-sort/_doc/changelog.md +0 -0
- package/uview-plus/components/u-drag-sort/_doc/package.json +85 -0
- package/uview-plus/components/u-drag-sort/_doc/readme.md +16 -0
- package/uview-plus/components/u-drag-sort/u-drag-sort.vue +3 -0
- package/uview-plus/components/u-empty/u-empty.vue +27 -1
- package/uview-plus/components/u-gap/_doc/changelog.md +4 -0
- package/uview-plus/components/u-gap/_doc/package.json +86 -0
- package/uview-plus/components/u-gap/_doc/readme.md +22 -0
- package/uview-plus/components/u-icon/_doc/changelog.md +10 -0
- package/uview-plus/components/u-icon/_doc/package.json +85 -0
- package/uview-plus/components/u-icon/_doc/readme.md +10 -0
- package/uview-plus/components/u-icon/icon.js +23 -25
- package/uview-plus/components/u-icon/icons.js +213 -213
- package/uview-plus/components/u-icon/style.css +3 -3
- package/uview-plus/components/u-icon/u-icon2.vue +149 -0
- package/uview-plus/components/u-image-wu/_doc/changelog.md +21 -0
- package/uview-plus/components/u-image-wu/_doc/package.json +88 -0
- package/uview-plus/components/u-image-wu/_doc/readme.md +11 -0
- package/uview-plus/components/u-image-wu/props.js +94 -0
- package/uview-plus/components/u-image-wu/u-image-wu.vue +243 -0
- package/uview-plus/components/u-input/_doc/changelog.md +6 -0
- package/uview-plus/components/u-input/_doc/package.json +88 -0
- package/uview-plus/components/u-input/_doc/readme.md +16 -0
- package/uview-plus/components/u-line/_doc/changelog.md +8 -0
- package/uview-plus/components/u-line/_doc/package.json +86 -0
- package/uview-plus/components/u-line/_doc/readme.md +16 -0
- package/uview-plus/components/u-link/_doc/changelog.md +8 -0
- package/uview-plus/components/u-link/_doc/package.json +86 -0
- package/uview-plus/components/u-link/_doc/readme.md +20 -0
- package/uview-plus/components/u-loading-icon/_doc/changelog.md +12 -0
- package/uview-plus/components/u-loading-icon/_doc/package.json +86 -0
- package/uview-plus/components/u-loading-icon/_doc/readme.md +16 -0
- package/uview-plus/components/u-loading-icon/props.js +1 -1
- package/uview-plus/components/u-navbar/_doc/changelog.md +6 -0
- package/uview-plus/components/u-navbar/_doc/package.json +89 -0
- package/uview-plus/components/u-navbar/_doc/readme.md +16 -0
- package/uview-plus/components/u-navbar-wu/props.js +102 -0
- package/uview-plus/components/u-navbar-wu/u-navbar-wu.vue +196 -0
- package/uview-plus/components/u-number-box/_doc/changelog.md +19 -0
- package/uview-plus/components/u-number-box/_doc/package.json +88 -0
- package/uview-plus/components/u-number-box/_doc/readme.md +16 -0
- package/uview-plus/components/u-overlay/_doc/changelog.md +4 -0
- package/uview-plus/components/u-overlay/_doc/package.json +88 -0
- package/uview-plus/components/u-overlay/_doc/readme.md +16 -0
- package/uview-plus/components/u-popup/_doc/changelog.md +4 -0
- package/uview-plus/components/u-popup/_doc/package.json +92 -0
- package/uview-plus/components/u-popup/_doc/readme.md +16 -0
- package/uview-plus/components/u-popup-wu/keypress.js +45 -0
- package/uview-plus/components/u-popup-wu/u-popup-wu.vue +519 -0
- package/uview-plus/components/u-radio/_doc/changelog.md +6 -0
- package/uview-plus/components/u-radio/_doc/package.json +88 -0
- package/uview-plus/components/u-radio/_doc/readme.md +25 -0
- package/uview-plus/components/u-row/_doc/changelog.md +8 -0
- package/uview-plus/components/u-row/_doc/package.json +86 -0
- package/uview-plus/components/u-row/_doc/readme.md +16 -0
- package/uview-plus/components/u-safe-bottom/_doc/changelog.md +6 -0
- package/uview-plus/components/u-safe-bottom/_doc/package.json +86 -0
- package/uview-plus/components/u-safe-bottom/_doc/readme.md +16 -0
- package/uview-plus/components/u-sku-wu/_doc/changelog.md +27 -0
- package/uview-plus/components/u-sku-wu/_doc/package.json +93 -0
- package/uview-plus/components/u-sku-wu/_doc/readme.md +16 -0
- package/uview-plus/components/u-sku-wu/props.js +86 -0
- package/uview-plus/components/u-sku-wu/style.css +271 -0
- package/uview-plus/components/u-sku-wu/u-sku-wu.vue +864 -0
- package/uview-plus/components/u-status-bar/_doc/changelog.md +4 -0
- package/uview-plus/components/u-status-bar/_doc/package.json +86 -0
- package/uview-plus/components/u-status-bar/_doc/readme.md +16 -0
- package/uview-plus/components/u-text/_doc/changelog.md +10 -0
- package/uview-plus/components/u-text/_doc/package.json +89 -0
- package/uview-plus/components/u-text/_doc/readme.md +20 -0
- package/uview-plus/components/u-textarea/_doc/changelog.md +6 -0
- package/uview-plus/components/u-textarea/_doc/package.json +86 -0
- package/uview-plus/components/u-textarea/_doc/readme.md +25 -0
- package/uview-plus/components/u-transition/_doc/changelog.md +14 -0
- package/uview-plus/components/u-transition/_doc/package.json +86 -0
- package/uview-plus/components/u-transition/_doc/readme.md +16 -0
- package/uview-plus/components/u-transition-wu/createAnimation.js +148 -0
- package/uview-plus/components/u-transition-wu/props.js +32 -0
- package/uview-plus/components/u-transition-wu/u-transition.vue +300 -0
- package/uview-plus/components/u-verification-code/u-verification-code.vue +161 -0
- package/uview-plus/index.js +107 -94
- package/uview-plus/libs/config/config.js +46 -48
- package/uview-plus/libs/css/color.scss +32 -311
- package/uview-plus/libs/css/components-wu.scss +30 -0
- package/uview-plus/libs/css/vue.scss +10 -10
- package/uview-plus/libs/function/calc.js +61 -55
- package/uview-plus/libs/function/cc.js +66 -0
- package/uview-plus/libs/function/color/color-convert/CHANGELOG.md +54 -0
- package/uview-plus/libs/function/color/color-convert/LICENSE +21 -0
- package/uview-plus/libs/function/color/color-convert/README.md +68 -0
- package/uview-plus/libs/function/color/color-convert/conversions.js +839 -0
- package/uview-plus/libs/function/color/color-convert/index.js +81 -0
- package/uview-plus/libs/function/color/color-convert/package.json +48 -0
- package/uview-plus/libs/function/color/color-convert/route.js +97 -0
- package/uview-plus/libs/function/color/color-name/LICENSE +8 -0
- package/uview-plus/libs/function/color/color-name/README.md +11 -0
- package/uview-plus/libs/function/color/color-name/index.js +152 -0
- package/uview-plus/libs/function/color/color-name/package.json +28 -0
- package/uview-plus/libs/function/color/color-string/LICENSE +21 -0
- package/uview-plus/libs/function/color/color-string/README.md +62 -0
- package/uview-plus/libs/function/color/color-string/index.js +244 -0
- package/uview-plus/libs/function/color/color-string/package.json +39 -0
- package/uview-plus/libs/function/color/color.js +496 -0
- package/uview-plus/libs/function/color/index.js +158 -0
- package/uview-plus/libs/function/color/is-arrayish/LICENSE +21 -0
- package/uview-plus/libs/function/color/is-arrayish/README.md +16 -0
- package/uview-plus/libs/function/color/is-arrayish/index.js +9 -0
- package/uview-plus/libs/function/color/is-arrayish/package.json +45 -0
- package/uview-plus/libs/function/color/is-arrayish/yarn-error.log +1443 -0
- package/uview-plus/libs/function/color/simple-swizzle/LICENSE +21 -0
- package/uview-plus/libs/function/color/simple-swizzle/README.md +39 -0
- package/uview-plus/libs/function/color/simple-swizzle/index.js +29 -0
- package/uview-plus/libs/function/color/simple-swizzle/package.json +36 -0
- package/uview-plus/libs/function/colorGradient.js +108 -106
- package/uview-plus/libs/function/debounce.js +17 -17
- package/uview-plus/libs/function/digit.js +1 -3
- package/uview-plus/libs/function/http.js +3 -3
- package/uview-plus/libs/function/index-wu.js +231 -0
- package/uview-plus/libs/function/index.js +579 -566
- package/uview-plus/libs/function/platform.js +18 -18
- package/uview-plus/libs/function/test.js +135 -137
- package/uview-plus/libs/function/throttle.js +17 -17
- package/uview-plus/libs/luch-request/core/Request.js +199 -199
- package/uview-plus/libs/mixin/mpMixin.js +1 -0
- package/uview-plus/libs/mixin/openType.js +33 -0
- package/uview-plus/libs/util/async-validator.js +1343 -1343
- package/uview-plus/libs/util/dayjs.js +404 -0
- package/uview-plus/libs/util/route.js +101 -105
- package/uview-plus/package-wu-tool.json +84 -0
- package/uview-plus/package-wu.json +112 -0
- package/uview-plus/package.json +106 -95
- package/uview-plus/readme-wu.md +148 -0
- package/uview-ui/index.js +51 -52
- package/plugins/uni-upgrade.js +0 -294
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="u-button-wrapper">
|
|
3
|
+
<!-- #ifndef APP-NVUE -->
|
|
4
|
+
<!-- #ifdef MP -->
|
|
5
|
+
<!-- 为了解决微信小程序动态设置hover-class点击态不消失的BUG -->
|
|
6
|
+
<view class="u-button-wrapper--dis" v-if="disabled || loading"></view>
|
|
7
|
+
<button
|
|
8
|
+
:hover-start-time="Number(hoverStartTime)"
|
|
9
|
+
:hover-stay-time="Number(hoverStayTime)"
|
|
10
|
+
:form-type="formType"
|
|
11
|
+
:open-type="openType"
|
|
12
|
+
:app-parameter="appParameter"
|
|
13
|
+
:hover-stop-propagation="hoverStopPropagation"
|
|
14
|
+
:send-message-title="sendMessageTitle"
|
|
15
|
+
:send-message-path="sendMessagePath"
|
|
16
|
+
:lang="lang"
|
|
17
|
+
:data-name="dataName"
|
|
18
|
+
:session-from="sessionFrom"
|
|
19
|
+
:send-message-img="sendMessageImg"
|
|
20
|
+
:show-message-card="showMessageCard"
|
|
21
|
+
@getphonenumber="onGetPhoneNumber"
|
|
22
|
+
@getuserinfo="onGetUserInfo"
|
|
23
|
+
@error="onError"
|
|
24
|
+
@opensetting="onOpenSetting"
|
|
25
|
+
@launchapp="onLaunchApp"
|
|
26
|
+
@contact="onContact"
|
|
27
|
+
@chooseavatar="onChooseavatar"
|
|
28
|
+
@addgroupapp="onAddgroupapp"
|
|
29
|
+
@chooseaddress="onChooseaddress"
|
|
30
|
+
@subscribe="onSubscribe"
|
|
31
|
+
@login="onLogin"
|
|
32
|
+
@im="onIm"
|
|
33
|
+
hover-class="u-button--active"
|
|
34
|
+
class="u-button u-reset-button"
|
|
35
|
+
:style="[baseColor, addStyle(customStyle)]"
|
|
36
|
+
@tap="clickHandler"
|
|
37
|
+
:class="bemClass"
|
|
38
|
+
>
|
|
39
|
+
<template v-if="loading">
|
|
40
|
+
<u-loading-icon :mode="loadingMode" :size="loadingSize * 1.15" :color="loadingColor"></u-loading-icon>
|
|
41
|
+
<text class="u-button__loading-text" :style="[{ fontSize: textSize + 'px' }, addStyle(customTextStyle)]">
|
|
42
|
+
{{ loadingText || text }}
|
|
43
|
+
</text>
|
|
44
|
+
</template>
|
|
45
|
+
<template v-else>
|
|
46
|
+
<u-icon
|
|
47
|
+
v-if="icon"
|
|
48
|
+
:name="icon"
|
|
49
|
+
:color="iconColorCom"
|
|
50
|
+
:size="textSize * 1.35"
|
|
51
|
+
:customStyle="{ marginRight: '2px' }"
|
|
52
|
+
></u-icon>
|
|
53
|
+
<slot>
|
|
54
|
+
<text class="u-button__text" :style="[{ fontSize: textSize + 'px' }, addStyle(customTextStyle)]">{{ text }}</text>
|
|
55
|
+
</slot>
|
|
56
|
+
</template>
|
|
57
|
+
</button>
|
|
58
|
+
<!-- #endif -->
|
|
59
|
+
<!-- #ifndef MP -->
|
|
60
|
+
<button
|
|
61
|
+
:hover-start-time="Number(hoverStartTime)"
|
|
62
|
+
:hover-stay-time="Number(hoverStayTime)"
|
|
63
|
+
:form-type="formType"
|
|
64
|
+
:open-type="openType"
|
|
65
|
+
:app-parameter="appParameter"
|
|
66
|
+
:hover-stop-propagation="hoverStopPropagation"
|
|
67
|
+
:send-message-title="sendMessageTitle"
|
|
68
|
+
:send-message-path="sendMessagePath"
|
|
69
|
+
:lang="lang"
|
|
70
|
+
:data-name="dataName"
|
|
71
|
+
:session-from="sessionFrom"
|
|
72
|
+
:send-message-img="sendMessageImg"
|
|
73
|
+
:show-message-card="showMessageCard"
|
|
74
|
+
:hover-class="!disabled && !loading ? 'u-button--active' : ''"
|
|
75
|
+
class="u-button u-reset-button"
|
|
76
|
+
:style="[baseColor, addStyle(customStyle)]"
|
|
77
|
+
@tap="clickHandler"
|
|
78
|
+
:class="bemClass"
|
|
79
|
+
>
|
|
80
|
+
<template v-if="loading">
|
|
81
|
+
<u-loading-icon :mode="loadingMode" :size="loadingSize * 1.15" :color="loadingColor"></u-loading-icon>
|
|
82
|
+
<text class="u-button__loading-text" :style="[{ fontSize: textSize + 'px' }, addStyle(customTextStyle)]">
|
|
83
|
+
{{ loadingText || text }}
|
|
84
|
+
</text>
|
|
85
|
+
</template>
|
|
86
|
+
<template v-else>
|
|
87
|
+
<u-icon
|
|
88
|
+
v-if="icon"
|
|
89
|
+
:name="icon"
|
|
90
|
+
:color="iconColorCom"
|
|
91
|
+
:size="textSize * 1.35"
|
|
92
|
+
:customStyle="{ marginRight: '2px' }"
|
|
93
|
+
></u-icon>
|
|
94
|
+
<slot>
|
|
95
|
+
<text class="u-button__text" :style="[{ fontSize: textSize + 'px' }, addStyle(customTextStyle)]">{{ text }}</text>
|
|
96
|
+
</slot>
|
|
97
|
+
</template>
|
|
98
|
+
</button>
|
|
99
|
+
<!-- #endif -->
|
|
100
|
+
<!-- #endif -->
|
|
101
|
+
|
|
102
|
+
<!-- #ifdef APP-NVUE -->
|
|
103
|
+
<view
|
|
104
|
+
:hover-start-time="Number(hoverStartTime)"
|
|
105
|
+
:hover-stay-time="Number(hoverStayTime)"
|
|
106
|
+
class="u-button"
|
|
107
|
+
:hover-class="
|
|
108
|
+
!disabled && !loading && !color && (plain || type === 'info')
|
|
109
|
+
? 'u-button--active--plain'
|
|
110
|
+
: !disabled && !loading && !plain
|
|
111
|
+
? 'u-button--active'
|
|
112
|
+
: ''
|
|
113
|
+
"
|
|
114
|
+
@tap="clickHandler"
|
|
115
|
+
:class="bemClass"
|
|
116
|
+
:style="[baseColor, addStyle(customStyle)]"
|
|
117
|
+
>
|
|
118
|
+
<template v-if="loading">
|
|
119
|
+
<u-loading-icon :mode="loadingMode" :size="loadingSize * 1.15" :color="loadingColor"></u-loading-icon>
|
|
120
|
+
<text
|
|
121
|
+
class="u-button__loading-text"
|
|
122
|
+
:style="[nvueTextStyle, addStyle(customTextStyle)]"
|
|
123
|
+
:class="[plain && `u-button__text--plain--${type}`]"
|
|
124
|
+
>
|
|
125
|
+
{{ loadingText || text }}
|
|
126
|
+
</text>
|
|
127
|
+
</template>
|
|
128
|
+
<template v-else>
|
|
129
|
+
<u-icon v-if="icon" :name="icon" :color="iconColorCom" :size="textSize * 1.35"></u-icon>
|
|
130
|
+
<text
|
|
131
|
+
class="u-button__text"
|
|
132
|
+
:style="[
|
|
133
|
+
{
|
|
134
|
+
marginLeft: icon ? '2px' : 0
|
|
135
|
+
},
|
|
136
|
+
nvueTextStyle,
|
|
137
|
+
addStyle(customTextStyle)
|
|
138
|
+
]"
|
|
139
|
+
:class="[plain && `u-button__text--plain--${type}`]"
|
|
140
|
+
>
|
|
141
|
+
{{ text }}
|
|
142
|
+
</text>
|
|
143
|
+
</template>
|
|
144
|
+
</view>
|
|
145
|
+
<!-- #endif -->
|
|
146
|
+
</view>
|
|
147
|
+
</template>
|
|
148
|
+
|
|
149
|
+
<script>
|
|
150
|
+
import { throttle } from '../../libs/function/throttle.js';
|
|
151
|
+
import { mpMixin } from '../../libs/mixin/mpMixin.js';
|
|
152
|
+
import { mixin } from '../../libs/mixin/mixin.js';
|
|
153
|
+
import { button } from '../../libs/mixin/button.js';
|
|
154
|
+
import { openType } from '../../libs/mixin/openType.js';
|
|
155
|
+
import props from './props.js';
|
|
156
|
+
/**
|
|
157
|
+
* button 按钮
|
|
158
|
+
* @description Button 按钮
|
|
159
|
+
* @tutorial https://ijry.github.io/uview-plus/components/button.html
|
|
160
|
+
* @property {Boolean} hairline 是否显示按钮的细边框 (默认 true )
|
|
161
|
+
* @property {String} type 按钮的预置样式,info,primary,error,warning,success (默认 'info' )
|
|
162
|
+
* @value info 默认按钮
|
|
163
|
+
* @value primary 主题按钮
|
|
164
|
+
* @value error 危险按钮
|
|
165
|
+
* @value warning 警告按钮
|
|
166
|
+
* @value success 成功按钮
|
|
167
|
+
* @property {String} size 按钮尺寸,large,normal,mini (默认 normal)
|
|
168
|
+
* @value large 超大尺寸
|
|
169
|
+
* @value normal 普通尺寸
|
|
170
|
+
* @value mini 迷你尺寸
|
|
171
|
+
* @property {String} shape 按钮形状,circle(两边为半圆),square(带有一定的圆角) (默认 'square' )
|
|
172
|
+
* @value circle 两边为半圆
|
|
173
|
+
* @value square 带有一定的圆角
|
|
174
|
+
* @property {Boolean} plain 按钮是否镂空,背景色透明 (默认 false)
|
|
175
|
+
* @property {Boolean} disabled 是否禁用 (默认 false)
|
|
176
|
+
* @property {Boolean} loading 按钮名称前是否带 loading 图标(App-nvue 平台,在 ios 上为雪花,Android上为圆圈) (默认 false)
|
|
177
|
+
* @property {String | Number} loadingText 加载中提示文字
|
|
178
|
+
* @property {String} loadingMode 加载状态图标类型 (默认 'spinner' )
|
|
179
|
+
* @property {String | Number} loadingSize 加载图标大小 (默认 15 )
|
|
180
|
+
* @property {String} openType 开放能力,具体请看uniapp稳定关于button组件部分说明
|
|
181
|
+
* @property {String} formType 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
|
|
182
|
+
* @property {String} appParameter 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 (注:只微信小程序、QQ小程序有效)
|
|
183
|
+
* @property {Boolean} hoverStopPropagation 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效(默认 true )
|
|
184
|
+
* @property {String} lang 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文(默认 en )
|
|
185
|
+
* @property {String} sessionFrom 会话来源,openType="contact"时有效
|
|
186
|
+
* @property {String} sendMessageTitle 会话内消息卡片标题,openType="contact"时有效
|
|
187
|
+
* @property {String} sendMessagePath 会话内消息卡片点击跳转小程序路径,openType="contact"时有效
|
|
188
|
+
* @property {String} sendMessageImg 会话内消息卡片图片,openType="contact"时有效
|
|
189
|
+
* @property {Boolean} showMessageCard 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效(默认false)
|
|
190
|
+
* @property {String} dataName 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
|
|
191
|
+
* @property {String | Number} throttleTime 节流,一定时间内只能触发一次 (默认 0 )
|
|
192
|
+
* @property {String | Number} hoverStartTime 按住后多久出现点击态,单位毫秒 (默认 0 )
|
|
193
|
+
* @property {String | Number} hoverStayTime 手指松开后点击态保留时间,单位毫秒 (默认 200 )
|
|
194
|
+
* @property {String | Number} text 按钮文字,之所以通过props传入,是因为slot传入的话(注:nvue中无法控制文字的样式)
|
|
195
|
+
* @property {String} icon 按钮图标
|
|
196
|
+
* @property {String} iconColor 按钮图标颜色
|
|
197
|
+
* @property {String} color 按钮颜色,支持传入linear-gradient渐变色
|
|
198
|
+
* @property {Object} customStyle 定义需要用到的外部样式
|
|
199
|
+
* @event {Function} click 非禁止并且非加载中,才能点击
|
|
200
|
+
* @event {Function} getphonenumber open-type="getPhoneNumber"时有效
|
|
201
|
+
* @event {Function} getuserinfo 用户点击该按钮时,会返回获取到的用户信息,从返回参数的detail中获取到的值同uni.getUserInfo
|
|
202
|
+
* @event {Function} error 当使用开放能力时,发生错误的回调
|
|
203
|
+
* @event {Function} opensetting 在打开授权设置页并关闭后回调
|
|
204
|
+
* @event {Function} launchapp 打开 APP 成功的回调
|
|
205
|
+
* @example <u-button>千金散尽还复来</u-button>
|
|
206
|
+
*/
|
|
207
|
+
export default {
|
|
208
|
+
name: 'u-button',
|
|
209
|
+
// #ifdef MP
|
|
210
|
+
mixins: [mpMixin, mixin, button, openType, props],
|
|
211
|
+
// #endif
|
|
212
|
+
// #ifndef MP
|
|
213
|
+
mixins: [mpMixin, mixin, props],
|
|
214
|
+
// #endif
|
|
215
|
+
emits: ['click'],
|
|
216
|
+
data() {
|
|
217
|
+
return {};
|
|
218
|
+
},
|
|
219
|
+
computed: {
|
|
220
|
+
// 生成bem风格的类名
|
|
221
|
+
bemClass() {
|
|
222
|
+
// this.bem为一个computed变量,在mixin中
|
|
223
|
+
if (!this.color) {
|
|
224
|
+
return this.bem('button', ['type', 'shape', 'size'], ['disabled', 'plain', 'hairline']);
|
|
225
|
+
} else {
|
|
226
|
+
// 由于nvue的原因,在有color参数时,不需要传入type,否则会生成type相关的类型,影响最终的样式
|
|
227
|
+
return this.bem('button', ['shape', 'size'], ['disabled', 'plain', 'hairline']);
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
loadingColor() {
|
|
231
|
+
if (this.plain) {
|
|
232
|
+
// 如果有设置color值,则用color值,否则使用type主题颜色
|
|
233
|
+
return this.color ? this.color : '#3c9cff';
|
|
234
|
+
}
|
|
235
|
+
if (this.type === 'info') {
|
|
236
|
+
return '#c9c9c9';
|
|
237
|
+
}
|
|
238
|
+
return 'rgb(200, 200, 200)';
|
|
239
|
+
},
|
|
240
|
+
iconColorCom() {
|
|
241
|
+
// 如果是镂空状态,设置了color就用color值,否则使用主题颜色,
|
|
242
|
+
// u-icon的color能接受一个主题颜色的值
|
|
243
|
+
if (this.iconColor) return this.iconColor;
|
|
244
|
+
if (this.plain) {
|
|
245
|
+
return this.color ? this.color : this.type;
|
|
246
|
+
} else {
|
|
247
|
+
return this.type === 'info' ? '#000000' : '#ffffff';
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
baseColor() {
|
|
251
|
+
let style = {};
|
|
252
|
+
if (this.color) {
|
|
253
|
+
// 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
|
|
254
|
+
style.color = this.plain ? this.color : 'white';
|
|
255
|
+
if (!this.plain) {
|
|
256
|
+
// 非镂空,背景色使用自定义的颜色
|
|
257
|
+
style['background-color'] = this.color;
|
|
258
|
+
}
|
|
259
|
+
if (this.color.indexOf('gradient') !== -1) {
|
|
260
|
+
// 如果自定义的颜色为渐变色,不显示边框,以及通过backgroundImage设置渐变色
|
|
261
|
+
// weex文档说明可以写borderWidth的形式,为什么这里需要分开写?
|
|
262
|
+
// 因为weex是阿里巴巴为了部门业绩考核而做的你懂的东西,所以需要这么写才有效
|
|
263
|
+
if (!this.plain) {
|
|
264
|
+
style.borderTopWidth = '0';
|
|
265
|
+
style.borderRightWidth = '0';
|
|
266
|
+
style.borderBottomWidth = '0';
|
|
267
|
+
style.borderLeftWidth = '0';
|
|
268
|
+
style.backgroundImage = this.color;
|
|
269
|
+
} else {
|
|
270
|
+
style.border = '1px solid #000';
|
|
271
|
+
style.color = '#000';
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
// 非渐变色,则设置边框相关的属性
|
|
275
|
+
style.borderColor = this.color;
|
|
276
|
+
style.borderWidth = '1px';
|
|
277
|
+
style.borderStyle = 'solid';
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return style;
|
|
281
|
+
},
|
|
282
|
+
// nvue版本按钮的字体不会继承父组件的颜色,需要对每一个text组件进行单独的设置
|
|
283
|
+
nvueTextStyle() {
|
|
284
|
+
let style = {};
|
|
285
|
+
// 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
|
|
286
|
+
if (this.type === 'info') {
|
|
287
|
+
style.color = '#323233';
|
|
288
|
+
}
|
|
289
|
+
if (this.color) {
|
|
290
|
+
style.color = this.plain ? this.color : 'white';
|
|
291
|
+
}
|
|
292
|
+
style.fontSize = this.textSize + 'px';
|
|
293
|
+
return style;
|
|
294
|
+
},
|
|
295
|
+
// 字体大小
|
|
296
|
+
textSize() {
|
|
297
|
+
let fontSize = 14,
|
|
298
|
+
{ size } = this;
|
|
299
|
+
if (size === 'large') fontSize = 16;
|
|
300
|
+
if (size === 'normal') fontSize = 14;
|
|
301
|
+
if (size === 'small') fontSize = 12;
|
|
302
|
+
if (size === 'mini') fontSize = 10;
|
|
303
|
+
return fontSize;
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
methods: {
|
|
307
|
+
clickHandler() {
|
|
308
|
+
// 非禁止并且非加载中,才能点击
|
|
309
|
+
if (!this.disabled && !this.loading) {
|
|
310
|
+
// 进行节流控制,每this.throttle毫秒内,只在开始处执行
|
|
311
|
+
throttle(() => {
|
|
312
|
+
this.$emit('click');
|
|
313
|
+
}, this.throttleTime);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
</script>
|
|
319
|
+
|
|
320
|
+
<style lang="scss" scoped>
|
|
321
|
+
$show-reset-button: 1;
|
|
322
|
+
@import '../../libs/css/variable.css';
|
|
323
|
+
@import '../../libs/css/components.scss';
|
|
324
|
+
@import '../../libs/css/color.scss';
|
|
325
|
+
|
|
326
|
+
/* #ifndef APP-NVUE */
|
|
327
|
+
@import './vue.scss';
|
|
328
|
+
/* #endif */
|
|
329
|
+
|
|
330
|
+
/* #ifdef APP-NVUE */
|
|
331
|
+
// @import "./nvue.scss";
|
|
332
|
+
/* #endif */
|
|
333
|
+
|
|
334
|
+
$u-button-u-button-height: 40px !default;
|
|
335
|
+
$u-button-text-font-size: 15px !default;
|
|
336
|
+
$u-button-loading-text-font-size: 15px !default;
|
|
337
|
+
$u-button-loading-text-margin-left: 4px !default;
|
|
338
|
+
$u-button-large-width: 100% !default;
|
|
339
|
+
$u-button-large-height: 50px !default;
|
|
340
|
+
$u-button-normal-padding: 0 12px !default;
|
|
341
|
+
$u-button-large-padding: 0 15px !default;
|
|
342
|
+
$u-button-normal-font-size: 14px !default;
|
|
343
|
+
$u-button-small-min-width: 60px !default;
|
|
344
|
+
$u-button-small-height: 30px !default;
|
|
345
|
+
$u-button-small-padding: 0px 8px !default;
|
|
346
|
+
$u-button-mini-padding: 0px 8px !default;
|
|
347
|
+
$u-button-small-font-size: 12px !default;
|
|
348
|
+
$u-button-mini-height: 22px !default;
|
|
349
|
+
$u-button-mini-font-size: 10px !default;
|
|
350
|
+
$u-button-mini-min-width: 50px !default;
|
|
351
|
+
$u-button-disabled-opacity: 0.5 !default;
|
|
352
|
+
$u-button-info-color: #323233 !default;
|
|
353
|
+
$u-button-info-background-color: #fff !default;
|
|
354
|
+
$u-button-info-border-color: #ebedf0 !default;
|
|
355
|
+
$u-button-info-border-width: 1px !default;
|
|
356
|
+
$u-button-info-border-style: solid !default;
|
|
357
|
+
$u-button-success-color: #fff !default;
|
|
358
|
+
$u-button-success-background-color: $u-success !default;
|
|
359
|
+
$u-button-success-border-color: $u-button-success-background-color !default;
|
|
360
|
+
$u-button-success-border-width: 1px !default;
|
|
361
|
+
$u-button-success-border-style: solid !default;
|
|
362
|
+
$u-button-primary-color: #fff !default;
|
|
363
|
+
$u-button-primary-background-color: $u-primary !default;
|
|
364
|
+
$u-button-primary-border-color: $u-button-primary-background-color !default;
|
|
365
|
+
$u-button-primary-border-width: 1px !default;
|
|
366
|
+
$u-button-primary-border-style: solid !default;
|
|
367
|
+
$u-button-error-color: #fff !default;
|
|
368
|
+
$u-button-error-background-color: $u-error !default;
|
|
369
|
+
$u-button-error-border-color: $u-button-error-background-color !default;
|
|
370
|
+
$u-button-error-border-width: 1px !default;
|
|
371
|
+
$u-button-error-border-style: solid !default;
|
|
372
|
+
$u-button-warning-color: #fff !default;
|
|
373
|
+
$u-button-warning-background-color: $u-warning !default;
|
|
374
|
+
$u-button-warning-border-color: $u-button-warning-background-color !default;
|
|
375
|
+
$u-button-warning-border-width: 1px !default;
|
|
376
|
+
$u-button-warning-border-style: solid !default;
|
|
377
|
+
$u-button-block-width: 100% !default;
|
|
378
|
+
$u-button-circle-border-top-right-radius: 100px !default;
|
|
379
|
+
$u-button-circle-border-top-left-radius: 100px !default;
|
|
380
|
+
$u-button-circle-border-bottom-left-radius: 100px !default;
|
|
381
|
+
$u-button-circle-border-bottom-right-radius: 100px !default;
|
|
382
|
+
$u-button-square-border-top-right-radius: 3px !default;
|
|
383
|
+
$u-button-square-border-top-left-radius: 3px !default;
|
|
384
|
+
$u-button-square-border-bottom-left-radius: 3px !default;
|
|
385
|
+
$u-button-square-border-bottom-right-radius: 3px !default;
|
|
386
|
+
$u-button-icon-min-width: 1em !default;
|
|
387
|
+
$u-button-plain-background-color: #fff !default;
|
|
388
|
+
$u-button-hairline-border-width: 0.5px !default;
|
|
389
|
+
|
|
390
|
+
.u-button {
|
|
391
|
+
height: $u-button-u-button-height;
|
|
392
|
+
position: relative;
|
|
393
|
+
align-items: center;
|
|
394
|
+
justify-content: center;
|
|
395
|
+
@include flex;
|
|
396
|
+
/* #ifndef APP-NVUE */
|
|
397
|
+
box-sizing: border-box;
|
|
398
|
+
/* #endif */
|
|
399
|
+
flex-direction: row;
|
|
400
|
+
margin-left: auto;
|
|
401
|
+
margin-right: auto;
|
|
402
|
+
|
|
403
|
+
&__text {
|
|
404
|
+
font-size: $u-button-text-font-size;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
&__loading-text {
|
|
408
|
+
font-size: $u-button-loading-text-font-size;
|
|
409
|
+
margin-left: $u-button-loading-text-margin-left;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
&--large {
|
|
413
|
+
/* #ifndef APP-NVUE */
|
|
414
|
+
width: $u-button-large-width;
|
|
415
|
+
/* #endif */
|
|
416
|
+
height: $u-button-large-height;
|
|
417
|
+
padding: $u-button-large-padding;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
&--normal {
|
|
421
|
+
padding: $u-button-normal-padding;
|
|
422
|
+
font-size: $u-button-normal-font-size;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
&--small {
|
|
426
|
+
/* #ifndef APP-NVUE */
|
|
427
|
+
min-width: $u-button-small-min-width;
|
|
428
|
+
/* #endif */
|
|
429
|
+
height: $u-button-small-height;
|
|
430
|
+
padding: $u-button-small-padding;
|
|
431
|
+
font-size: $u-button-small-font-size;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
&--mini {
|
|
435
|
+
height: $u-button-mini-height;
|
|
436
|
+
font-size: $u-button-mini-font-size;
|
|
437
|
+
/* #ifndef APP-NVUE */
|
|
438
|
+
min-width: $u-button-mini-min-width;
|
|
439
|
+
/* #endif */
|
|
440
|
+
padding: $u-button-mini-padding;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
&--disabled {
|
|
444
|
+
opacity: $u-button-disabled-opacity;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
&--info {
|
|
448
|
+
color: $u-button-info-color;
|
|
449
|
+
background-color: $u-button-info-background-color;
|
|
450
|
+
border-color: $u-button-info-border-color;
|
|
451
|
+
border-width: $u-button-info-border-width;
|
|
452
|
+
border-style: $u-button-info-border-style;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
&--success {
|
|
456
|
+
color: $u-button-success-color;
|
|
457
|
+
background-color: $u-button-success-background-color;
|
|
458
|
+
border-color: $u-button-success-border-color;
|
|
459
|
+
border-width: $u-button-success-border-width;
|
|
460
|
+
border-style: $u-button-success-border-style;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
&--primary {
|
|
464
|
+
color: $u-button-primary-color;
|
|
465
|
+
background-color: $u-button-primary-background-color;
|
|
466
|
+
border-color: $u-button-primary-border-color;
|
|
467
|
+
border-width: $u-button-primary-border-width;
|
|
468
|
+
border-style: $u-button-primary-border-style;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
&--error {
|
|
472
|
+
color: $u-button-error-color;
|
|
473
|
+
background-color: $u-button-error-background-color;
|
|
474
|
+
border-color: $u-button-error-border-color;
|
|
475
|
+
border-width: $u-button-error-border-width;
|
|
476
|
+
border-style: $u-button-error-border-style;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
&--warning {
|
|
480
|
+
color: $u-button-warning-color;
|
|
481
|
+
background-color: $u-button-warning-background-color;
|
|
482
|
+
border-color: $u-button-warning-border-color;
|
|
483
|
+
border-width: $u-button-warning-border-width;
|
|
484
|
+
border-style: $u-button-warning-border-style;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
&--block {
|
|
488
|
+
@include flex;
|
|
489
|
+
width: $u-button-block-width;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
&--circle {
|
|
493
|
+
border-top-right-radius: $u-button-circle-border-top-right-radius;
|
|
494
|
+
border-top-left-radius: $u-button-circle-border-top-left-radius;
|
|
495
|
+
border-bottom-left-radius: $u-button-circle-border-bottom-left-radius;
|
|
496
|
+
border-bottom-right-radius: $u-button-circle-border-bottom-right-radius;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
&--square {
|
|
500
|
+
border-bottom-left-radius: $u-button-square-border-top-right-radius;
|
|
501
|
+
border-bottom-right-radius: $u-button-square-border-top-left-radius;
|
|
502
|
+
border-top-left-radius: $u-button-square-border-bottom-left-radius;
|
|
503
|
+
border-top-right-radius: $u-button-square-border-bottom-right-radius;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
&__icon {
|
|
507
|
+
/* #ifndef APP-NVUE */
|
|
508
|
+
min-width: $u-button-icon-min-width;
|
|
509
|
+
line-height: inherit !important;
|
|
510
|
+
vertical-align: top;
|
|
511
|
+
/* #endif */
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
&--plain {
|
|
515
|
+
background-color: $u-button-plain-background-color;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
&--hairline {
|
|
519
|
+
border-width: $u-button-hairline-border-width !important;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
</style>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// nvue下hover-class无效
|
|
2
|
+
$u-button-before-top:50% !default;
|
|
3
|
+
$u-button-before-left:50% !default;
|
|
4
|
+
$u-button-before-width:100% !default;
|
|
5
|
+
$u-button-before-height:100% !default;
|
|
6
|
+
$u-button-before-transform:translate(-50%, -50%) !default;
|
|
7
|
+
$u-button-before-opacity:0 !default;
|
|
8
|
+
$u-button-before-background-color:#000 !default;
|
|
9
|
+
$u-button-before-border-color:#000 !default;
|
|
10
|
+
$u-button-active-before-opacity:.15 !default;
|
|
11
|
+
$u-button-icon-margin-left:4px !default;
|
|
12
|
+
$u-button-plain-u-button-info-color:$u-info;
|
|
13
|
+
$u-button-plain-u-button-success-color:$u-success;
|
|
14
|
+
$u-button-plain-u-button-error-color:$u-error;
|
|
15
|
+
$u-button-plain-u-button-warning-color:$u-warning;
|
|
16
|
+
|
|
17
|
+
.u-button {
|
|
18
|
+
width: 100%;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
|
|
21
|
+
&__text {
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
line-height: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:before {
|
|
27
|
+
position: absolute;
|
|
28
|
+
top:$u-button-before-top;
|
|
29
|
+
left:$u-button-before-left;
|
|
30
|
+
width:$u-button-before-width;
|
|
31
|
+
height:$u-button-before-height;
|
|
32
|
+
border: inherit;
|
|
33
|
+
border-radius: inherit;
|
|
34
|
+
transform:$u-button-before-transform;
|
|
35
|
+
opacity:$u-button-before-opacity;
|
|
36
|
+
content: " ";
|
|
37
|
+
background-color:$u-button-before-background-color;
|
|
38
|
+
border-color:$u-button-before-border-color;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--active {
|
|
42
|
+
&:before {
|
|
43
|
+
opacity: .15
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__icon+&__text:not(:empty),
|
|
48
|
+
&__loading-text {
|
|
49
|
+
margin-left:$u-button-icon-margin-left;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&--plain {
|
|
53
|
+
&.u-button--primary {
|
|
54
|
+
color: $u-primary;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&--plain {
|
|
59
|
+
&.u-button--info {
|
|
60
|
+
color:$u-button-plain-u-button-info-color;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&--plain {
|
|
65
|
+
&.u-button--success {
|
|
66
|
+
color:$u-button-plain-u-button-success-color;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&--plain {
|
|
71
|
+
&.u-button--error {
|
|
72
|
+
color:$u-button-plain-u-button-error-color;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--plain {
|
|
77
|
+
&.u-button--warning {
|
|
78
|
+
color:$u-button-plain-u-button-warning-color;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|