@gmcb/uv-ui 0.2.26
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/CHANGELOG.md +295 -0
- package/LICENSE +21 -0
- package/README.md +164 -0
- package/components/uv-action-sheet/props.js +50 -0
- package/components/uv-action-sheet/uv-action-sheet.vue +280 -0
- package/components/uv-album/uv-album.vue +312 -0
- package/components/uv-alert/props.js +45 -0
- package/components/uv-alert/uv-alert.vue +246 -0
- package/components/uv-avatar/props.js +85 -0
- package/components/uv-avatar/uv-avatar.vue +182 -0
- package/components/uv-avatar-group/props.js +53 -0
- package/components/uv-avatar-group/uv-avatar-group.vue +106 -0
- package/components/uv-back-top/props.js +58 -0
- package/components/uv-back-top/uv-back-top.vue +116 -0
- package/components/uv-badge/props.js +73 -0
- package/components/uv-badge/uv-badge.vue +176 -0
- package/components/uv-button/nvue.scss +46 -0
- package/components/uv-button/props.js +163 -0
- package/components/uv-button/uv-button.vue +529 -0
- package/components/uv-button/vue.scss +93 -0
- package/components/uv-calendar/calendar.js +546 -0
- package/components/uv-calendar/header.vue +104 -0
- package/components/uv-calendar/month.vue +616 -0
- package/components/uv-calendar/props.js +145 -0
- package/components/uv-calendar/uv-calendar.vue +390 -0
- package/components/uv-calendars/calendar-body.vue +376 -0
- package/components/uv-calendars/calendar-item.vue +248 -0
- package/components/uv-calendars/calendar.js +546 -0
- package/components/uv-calendars/i18n/en.json +12 -0
- package/components/uv-calendars/i18n/index.js +8 -0
- package/components/uv-calendars/i18n/zh-Hans.json +12 -0
- package/components/uv-calendars/i18n/zh-Hant.json +12 -0
- package/components/uv-calendars/util.js +435 -0
- package/components/uv-calendars/uv-calendars.vue +452 -0
- package/components/uv-cell/props.js +116 -0
- package/components/uv-cell/uv-cell.vue +209 -0
- package/components/uv-cell-group/props.js +15 -0
- package/components/uv-cell-group/uv-cell-group.vue +63 -0
- package/components/uv-checkbox/props.js +70 -0
- package/components/uv-checkbox/uv-checkbox.vue +371 -0
- package/components/uv-checkbox-group/props.js +84 -0
- package/components/uv-checkbox-group/uv-checkbox-group.vue +119 -0
- package/components/uv-code/props.js +35 -0
- package/components/uv-code/uv-code.vue +136 -0
- package/components/uv-code-input/props.js +83 -0
- package/components/uv-code-input/uv-code-input.vue +272 -0
- package/components/uv-col/props.js +30 -0
- package/components/uv-col/uv-col.vue +165 -0
- package/components/uv-collapse/props.js +20 -0
- package/components/uv-collapse/uv-collapse.vue +86 -0
- package/components/uv-collapse-item/props.js +60 -0
- package/components/uv-collapse-item/uv-collapse-item.vue +228 -0
- package/components/uv-column-notice/props.js +61 -0
- package/components/uv-column-notice/uv-column-notice.vue +176 -0
- package/components/uv-count-down/props.js +25 -0
- package/components/uv-count-down/utils.js +62 -0
- package/components/uv-count-down/uv-count-down.vue +169 -0
- package/components/uv-count-to/props.js +60 -0
- package/components/uv-count-to/uv-count-to.vue +187 -0
- package/components/uv-datetime-picker/props.js +130 -0
- package/components/uv-datetime-picker/uv-datetime-picker.vue +355 -0
- package/components/uv-divider/props.js +45 -0
- package/components/uv-divider/uv-divider.vue +113 -0
- package/components/uv-drop-down/uv-drop-down.vue +135 -0
- package/components/uv-drop-down-item/uv-drop-down-item.vue +169 -0
- package/components/uv-drop-down-popup/uv-drop-down-popup.vue +242 -0
- package/components/uv-empty/props.js +60 -0
- package/components/uv-empty/uv-empty.vue +126 -0
- package/components/uv-form/props.js +46 -0
- package/components/uv-form/uv-form.vue +209 -0
- package/components/uv-form/valid.js +1343 -0
- package/components/uv-form-item/props.js +49 -0
- package/components/uv-form-item/uv-form-item.vue +226 -0
- package/components/uv-gap/props.js +25 -0
- package/components/uv-gap/uv-gap.vue +36 -0
- package/components/uv-grid/props.js +20 -0
- package/components/uv-grid/uv-grid.vue +100 -0
- package/components/uv-grid-item/props.js +15 -0
- package/components/uv-grid-item/uv-grid-item.vue +223 -0
- package/components/uv-icon/icons.js +160 -0
- package/components/uv-icon/props.js +90 -0
- package/components/uv-icon/uv-icon.vue +226 -0
- package/components/uv-icon/uvicons.ttf +0 -0
- package/components/uv-image/props.js +100 -0
- package/components/uv-image/uv-image.vue +296 -0
- package/components/uv-index-anchor/props.js +30 -0
- package/components/uv-index-anchor/uv-index-anchor.vue +98 -0
- package/components/uv-index-item/uv-index-item.vue +87 -0
- package/components/uv-index-list/props.js +30 -0
- package/components/uv-index-list/uv-index-list.vue +461 -0
- package/components/uv-input/props.js +175 -0
- package/components/uv-input/uv-input.vue +348 -0
- package/components/uv-keyboard/props.js +95 -0
- package/components/uv-keyboard/uv-keyboard.vue +180 -0
- package/components/uv-keyboard-car/props.js +24 -0
- package/components/uv-keyboard-car/uv-keyboard-car.vue +347 -0
- package/components/uv-keyboard-number/props.js +19 -0
- package/components/uv-keyboard-number/uv-keyboard-number.vue +201 -0
- package/components/uv-line/props.js +34 -0
- package/components/uv-line/uv-line.vue +60 -0
- package/components/uv-line-progress/props.js +29 -0
- package/components/uv-line-progress/uv-line-progress.vue +146 -0
- package/components/uv-link/props.js +40 -0
- package/components/uv-link/uv-link.vue +83 -0
- package/components/uv-list/uv-list.vue +147 -0
- package/components/uv-list-item/uv-list-item.vue +535 -0
- package/components/uv-load-more/props.js +95 -0
- package/components/uv-load-more/uv-load-more.vue +152 -0
- package/components/uv-loading-icon/props.js +67 -0
- package/components/uv-loading-icon/uv-loading-icon.vue +347 -0
- package/components/uv-loading-page/props.js +55 -0
- package/components/uv-loading-page/uv-loading-page.vue +96 -0
- package/components/uv-modal/props.js +90 -0
- package/components/uv-modal/uv-modal.vue +245 -0
- package/components/uv-navbar/props.js +89 -0
- package/components/uv-navbar/uv-navbar.vue +245 -0
- package/components/uv-no-network/props.js +20 -0
- package/components/uv-no-network/uv-no-network.vue +222 -0
- package/components/uv-notice-bar/props.js +76 -0
- package/components/uv-notice-bar/uv-notice-bar.vue +110 -0
- package/components/uv-notify/props.js +45 -0
- package/components/uv-notify/uv-notify.vue +220 -0
- package/components/uv-number-box/props.js +118 -0
- package/components/uv-number-box/uv-number-box.vue +397 -0
- package/components/uv-overlay/props.js +25 -0
- package/components/uv-overlay/uv-overlay.vue +85 -0
- package/components/uv-parse/node/node.vue +576 -0
- package/components/uv-parse/parser.js +1335 -0
- package/components/uv-parse/uv-parse.vue +498 -0
- package/components/uv-pick-color/colors.js +217 -0
- package/components/uv-pick-color/props.js +47 -0
- package/components/uv-pick-color/uv-pick-color.vue +551 -0
- package/components/uv-picker/props.js +95 -0
- package/components/uv-picker/uv-picker.vue +329 -0
- package/components/uv-popup/keypress.js +45 -0
- package/components/uv-popup/uv-popup.vue +537 -0
- package/components/uv-preview-video/uv-preview-video.vue +52 -0
- package/components/uv-qrcode/cache.js +1 -0
- package/components/uv-qrcode/gcanvas/bridge/bridge-weex.js +241 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStylePattern.js +8 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
- package/components/uv-qrcode/gcanvas/context-2d/RenderingContext.js +666 -0
- package/components/uv-qrcode/gcanvas/context-webgl/ActiveInfo.js +11 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Buffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Framebuffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLenum.js +298 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLmethod.js +142 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLtype.js +23 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Program.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Renderbuffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/RenderingContext.js +1191 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Shader.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Texture.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/UniformLocation.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/classUtils.js +3 -0
- package/components/uv-qrcode/gcanvas/env/canvas.js +74 -0
- package/components/uv-qrcode/gcanvas/env/image.js +96 -0
- package/components/uv-qrcode/gcanvas/env/tool.js +24 -0
- package/components/uv-qrcode/gcanvas/index.js +39 -0
- package/components/uv-qrcode/props.js +85 -0
- package/components/uv-qrcode/qrcode.js +34 -0
- package/components/uv-qrcode/queue.js +41 -0
- package/components/uv-qrcode/uv-qrcode.vue +1038 -0
- package/components/uv-radio/props.js +65 -0
- package/components/uv-radio/uv-radio.vue +349 -0
- package/components/uv-radio-group/props.js +89 -0
- package/components/uv-radio-group/uv-radio-group.vue +115 -0
- package/components/uv-rate/props.js +73 -0
- package/components/uv-rate/uv-rate.vue +274 -0
- package/components/uv-read-more/props.js +62 -0
- package/components/uv-read-more/uv-read-more.vue +162 -0
- package/components/uv-row/props.js +20 -0
- package/components/uv-row/uv-row.vue +95 -0
- package/components/uv-row-notice/props.js +40 -0
- package/components/uv-row-notice/uv-row-notice.vue +341 -0
- package/components/uv-safe-bottom/uv-safe-bottom.vue +67 -0
- package/components/uv-scroll-list/nvue.js +29 -0
- package/components/uv-scroll-list/props.js +35 -0
- package/components/uv-scroll-list/scrollWxs.wxs +51 -0
- package/components/uv-scroll-list/uv-scroll-list.vue +218 -0
- package/components/uv-search/props.js +127 -0
- package/components/uv-search/uv-search.vue +311 -0
- package/components/uv-skeleton/props.js +65 -0
- package/components/uv-skeleton/uv-skeleton.vue +250 -0
- package/components/uv-skeletons/uv-skeletons.vue +247 -0
- package/components/uv-slider/props.js +58 -0
- package/components/uv-slider/uv-slider.vue +58 -0
- package/components/uv-status-bar/props.js +8 -0
- package/components/uv-status-bar/uv-status-bar.vue +54 -0
- package/components/uv-steps/props.js +40 -0
- package/components/uv-steps/uv-steps.vue +83 -0
- package/components/uv-steps-item/props.js +25 -0
- package/components/uv-steps-item/uv-steps-item.vue +347 -0
- package/components/uv-sticky/props.js +41 -0
- package/components/uv-sticky/uv-sticky.vue +223 -0
- package/components/uv-subsection/props.js +54 -0
- package/components/uv-subsection/uv-subsection.vue +269 -0
- package/components/uv-swipe-action/props.js +10 -0
- package/components/uv-swipe-action/uv-swipe-action.vue +65 -0
- package/components/uv-swipe-action-item/index - backup.wxs +256 -0
- package/components/uv-swipe-action-item/index.wxs +225 -0
- package/components/uv-swipe-action-item/nvue - backup.js +264 -0
- package/components/uv-swipe-action-item/nvue.js +182 -0
- package/components/uv-swipe-action-item/props.js +40 -0
- package/components/uv-swipe-action-item/uv-swipe-action-item.vue +200 -0
- package/components/uv-swipe-action-item/wxs.js +15 -0
- package/components/uv-swiper/props.js +136 -0
- package/components/uv-swiper/uv-swiper.vue +263 -0
- package/components/uv-swiper-indicator/props.js +30 -0
- package/components/uv-swiper-indicator/uv-swiper-indicator.vue +112 -0
- package/components/uv-switch/props.js +58 -0
- package/components/uv-switch/uv-switch.vue +182 -0
- package/components/uv-tabbar/props.js +50 -0
- package/components/uv-tabbar/uv-tabbar.vue +146 -0
- package/components/uv-tabbar-item/props.js +40 -0
- package/components/uv-tabbar-item/uv-tabbar-item.vue +146 -0
- package/components/uv-tabs/props.js +71 -0
- package/components/uv-tabs/uv-tabs.vue +391 -0
- package/components/uv-tags/props.js +104 -0
- package/components/uv-tags/uv-tags.vue +379 -0
- package/components/uv-text/props.js +113 -0
- package/components/uv-text/uv-text.vue +218 -0
- package/components/uv-text/value.js +87 -0
- package/components/uv-textarea/props.js +138 -0
- package/components/uv-textarea/uv-textarea.vue +238 -0
- package/components/uv-toast/uv-toast.vue +292 -0
- package/components/uv-toolbar/props.js +40 -0
- package/components/uv-toolbar/uv-toolbar.vue +109 -0
- package/components/uv-tooltip/props.js +60 -0
- package/components/uv-tooltip/uv-tooltip.vue +372 -0
- package/components/uv-transition/createAnimation.js +131 -0
- package/components/uv-transition/props.js +31 -0
- package/components/uv-transition/uv-transition.vue +320 -0
- package/components/uv-upload/mixin.js +22 -0
- package/components/uv-upload/props.js +130 -0
- package/components/uv-upload/utils.js +151 -0
- package/components/uv-upload/uv-upload.vue +488 -0
- package/components/uv-vtabs/props.js +79 -0
- package/components/uv-vtabs/uv-vtabs.vue +438 -0
- package/components/uv-vtabs-item/uv-vtabs-item.vue +68 -0
- package/components/uv-waterfall/props.js +69 -0
- package/components/uv-waterfall/uv-waterfall.vue +265 -0
- package/index.js +82 -0
- package/index.scss +7 -0
- package/libs/config/config.js +34 -0
- package/libs/css/color.scss +32 -0
- package/libs/css/common.scss +100 -0
- package/libs/css/components.scss +23 -0
- package/libs/css/variable.scss +111 -0
- package/libs/css/vue.scss +40 -0
- package/libs/function/colorGradient.js +134 -0
- package/libs/function/compress.js +27 -0
- package/libs/function/debounce.js +29 -0
- package/libs/function/digit.js +167 -0
- package/libs/function/index.js +734 -0
- package/libs/function/platform.js +75 -0
- package/libs/function/test.js +287 -0
- package/libs/function/throttle.js +30 -0
- package/libs/luch-request/adapters/index.js +132 -0
- package/libs/luch-request/core/InterceptorManager.js +51 -0
- package/libs/luch-request/core/Request.js +201 -0
- package/libs/luch-request/core/buildFullPath.js +20 -0
- package/libs/luch-request/core/defaults.js +33 -0
- package/libs/luch-request/core/dispatchRequest.js +6 -0
- package/libs/luch-request/core/mergeConfig.js +126 -0
- package/libs/luch-request/core/settle.js +16 -0
- package/libs/luch-request/helpers/buildURL.js +64 -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 +197 -0
- package/libs/luch-request/index.js +2 -0
- package/libs/luch-request/utils/clone.js +264 -0
- package/libs/luch-request/utils.js +135 -0
- package/libs/mixin/button.js +13 -0
- package/libs/mixin/mixin.js +172 -0
- package/libs/mixin/mpMixin.js +8 -0
- package/libs/mixin/mpShare.js +13 -0
- package/libs/mixin/openType.js +47 -0
- package/libs/mixin/touch.js +59 -0
- package/libs/util/dayjs.js +216 -0
- package/libs/util/route.js +126 -0
- package/package.json +28 -0
- package/theme.scss +43 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="uv-waterfall">
|
|
3
|
+
<!-- #ifndef APP-NVUE -->
|
|
4
|
+
<view class="uv-waterfall__gap_left" :style="[gapLeftStyle]"></view>
|
|
5
|
+
<template v-if="columnNum>=1">
|
|
6
|
+
<view id="uv-waterfall-1" class="uv-waterfall__column">
|
|
7
|
+
<slot name="list1"></slot>
|
|
8
|
+
</view>
|
|
9
|
+
</template>
|
|
10
|
+
<template v-if="columnNum>=2">
|
|
11
|
+
<view class="uv-waterfall__gap_center" :style="[gapCenterStyle]"></view>
|
|
12
|
+
<view id="uv-waterfall-2" class="uv-waterfall__column">
|
|
13
|
+
<slot name="list2"></slot>
|
|
14
|
+
</view>
|
|
15
|
+
</template>
|
|
16
|
+
<template v-if="columnNum>=3">
|
|
17
|
+
<view class="uv-waterfall__gap_center" :style="[gapCenterStyle]"></view>
|
|
18
|
+
<view id="uv-waterfall-3" class="uv-waterfall__column">
|
|
19
|
+
<slot name="list3"></slot>
|
|
20
|
+
</view>
|
|
21
|
+
</template>
|
|
22
|
+
<template v-if="columnNum>=4">
|
|
23
|
+
<view class="uv-waterfall__gap_center" :style="[gapCenterStyle]">
|
|
24
|
+
</view>
|
|
25
|
+
<view id="uv-waterfall-4" class="uv-waterfall__column">
|
|
26
|
+
<slot name="list4"></slot>
|
|
27
|
+
</view>
|
|
28
|
+
</template>
|
|
29
|
+
<template v-if="columnNum>=5">
|
|
30
|
+
<view class="uv-waterfall__gap_center" :style="[gapCenterStyle]">
|
|
31
|
+
</view>
|
|
32
|
+
<view id="uv-waterfall-5" class="uv-waterfall__column">
|
|
33
|
+
<slot name="list5"></slot>
|
|
34
|
+
</view>
|
|
35
|
+
</template>
|
|
36
|
+
<view class="uv-waterfall__gap_right" :style="[gapRightStyle]">
|
|
37
|
+
</view>
|
|
38
|
+
<!-- #endif -->
|
|
39
|
+
<!-- #ifdef APP-NVUE -->
|
|
40
|
+
<view class="waterfall-warapper">
|
|
41
|
+
<waterfall :column-count="columnNum" :show-scrollbar="false" column-width="auto" :column-gap="columnGap" :left-gap="leftGap" :right-gap="rightGap" :always-scrollable-vertical="true" :style="[nvueWaterfallStyle]"
|
|
42
|
+
@loadmore="scrolltolower">
|
|
43
|
+
<slot></slot>
|
|
44
|
+
</waterfall>
|
|
45
|
+
</view>
|
|
46
|
+
<!-- #endif -->
|
|
47
|
+
</view>
|
|
48
|
+
</template>
|
|
49
|
+
<script>
|
|
50
|
+
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
51
|
+
import mixin from '../../libs/mixin/mixin.js'
|
|
52
|
+
import props from './props.js';
|
|
53
|
+
/**
|
|
54
|
+
* 瀑布流
|
|
55
|
+
* @description 该组件兼容所有端,nvue参考https://uniapp.dcloud.net.cn/component/waterfall.html
|
|
56
|
+
* @tutorial https://www.uvui.cn/components/list.html
|
|
57
|
+
* @property {Array} value/modelValue 瀑布流数组数据,非nvue生效 (默认 [] )
|
|
58
|
+
* @property {String} idKey 数据的id值,根据id值对数据执行删除操作,如数据为:{id: 1, name: 'uv-ui'},那么该值设置为id,非nvue有效 (默认 '' )
|
|
59
|
+
* @property {String | Number} addTime 每次插入数据的事件间隔,间隔越长能保证两列高度相近,但是用户体验不好,单位ms,非nvue生效(默认 200 )
|
|
60
|
+
* @property {String | Number} columnCount 瀑布流的列数(默认 2 )
|
|
61
|
+
* @property {String | Number} columnGap 列与列的间隙(默认 0 )
|
|
62
|
+
* @property {String | Number} leftGap 左边和列表的间隙(默认 0 )
|
|
63
|
+
* @property {String | Number} rightGap 右边和列表的间隙(默认 0 )
|
|
64
|
+
* @property {Boolean} showScrollbar 控制是否出现滚动条,仅nvue有效 (默认 false )
|
|
65
|
+
* @property {String | Number} columnWidth 描述瀑布流每一列的列宽,nvue生效 (默认 auto)
|
|
66
|
+
* @property {String | Number} width 瀑布流的宽度,nvue生效 (默认 屏幕宽 )
|
|
67
|
+
* @property {String | Number} height 瀑布流的高度,nvue生效 (默认 屏幕高 )
|
|
68
|
+
* @property {Object} customStyle 定义需要用到的外部样式
|
|
69
|
+
*
|
|
70
|
+
* @example <uv-waterfall v-model="list"></uv-waterfall>
|
|
71
|
+
*/
|
|
72
|
+
export default {
|
|
73
|
+
name: 'uv-waterfall',
|
|
74
|
+
mixins: [mpMixin, mixin, props],
|
|
75
|
+
data() {
|
|
76
|
+
return {
|
|
77
|
+
list1: [],
|
|
78
|
+
list2: [],
|
|
79
|
+
list3: [],
|
|
80
|
+
list4: [],
|
|
81
|
+
list5: [],
|
|
82
|
+
// 临时列表
|
|
83
|
+
tempList: []
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
computed: {
|
|
87
|
+
// 破坏value变量引用,否则数据会保持不变
|
|
88
|
+
copyValue() {
|
|
89
|
+
// #ifdef VUE2
|
|
90
|
+
return this.$uv.deepClone(this.value)
|
|
91
|
+
// #endif
|
|
92
|
+
// #ifdef VUE3
|
|
93
|
+
return this.$uv.deepClone(this.modelValue)
|
|
94
|
+
// #endif
|
|
95
|
+
},
|
|
96
|
+
columnNum() {
|
|
97
|
+
return this.columnCount <= 0 ? 0 : this.columnCount >= 5 ? 5 : this.columnCount;
|
|
98
|
+
},
|
|
99
|
+
gapLeftStyle() {
|
|
100
|
+
const style = {}
|
|
101
|
+
style.width = this.$uv.addUnit(this.leftGap)
|
|
102
|
+
return style;
|
|
103
|
+
},
|
|
104
|
+
gapRightStyle() {
|
|
105
|
+
const style = {}
|
|
106
|
+
style.width = this.$uv.addUnit(this.rightGap)
|
|
107
|
+
return style;
|
|
108
|
+
},
|
|
109
|
+
gapCenterStyle() {
|
|
110
|
+
const style = {}
|
|
111
|
+
style.width = this.$uv.addUnit(this.columnGap)
|
|
112
|
+
return style;
|
|
113
|
+
},
|
|
114
|
+
nvueWaterfallStyle() {
|
|
115
|
+
const style = {};
|
|
116
|
+
if (this.width != 0) style.width = this.$uv.addUnit(this.width)
|
|
117
|
+
if (this.height != 0) style.height = this.$uv.addUnit(this.height)
|
|
118
|
+
// 如果没有定义列表高度,则默认使用屏幕高度
|
|
119
|
+
if (!style.width) style.width = this.$uv.addUnit(this.$uv.sys().windowWidth, 'px')
|
|
120
|
+
if (!style.height) style.height = this.$uv.addUnit(this.$uv.sys().windowHeight, 'px')
|
|
121
|
+
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle))
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
watch: {
|
|
125
|
+
copyValue(nVal, oVal) {
|
|
126
|
+
// #ifndef APP-NVUE
|
|
127
|
+
if (nVal.length != 0) {
|
|
128
|
+
// 取出数组发生变化的部分
|
|
129
|
+
let startIndex = Array.isArray(oVal) && oVal.length > 0 ? oVal.length : 0
|
|
130
|
+
// 拼接原有数据
|
|
131
|
+
this.tempList = this.tempList.concat(this.$uv.deepClone(nVal.slice(startIndex)))
|
|
132
|
+
this.splitData()
|
|
133
|
+
}
|
|
134
|
+
// #endif
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
mounted() {
|
|
138
|
+
// #ifndef APP-NVUE
|
|
139
|
+
this.tempList = this.$uv.deepClone(this.copyValue)
|
|
140
|
+
this.splitData()
|
|
141
|
+
// #endif
|
|
142
|
+
},
|
|
143
|
+
methods: {
|
|
144
|
+
// 滚动到底部触发事件
|
|
145
|
+
scrolltolower(e) {
|
|
146
|
+
this.$uv.sleep(30).then(() => {
|
|
147
|
+
this.$emit('scrolltolower')
|
|
148
|
+
})
|
|
149
|
+
},
|
|
150
|
+
// 拆分数据
|
|
151
|
+
async splitData() {
|
|
152
|
+
let rectArr = [];
|
|
153
|
+
let emitList = {};
|
|
154
|
+
if (!this.tempList.length) return
|
|
155
|
+
for (let i = 1; i <= this.columnNum; i++) {
|
|
156
|
+
const rect = await this.$uvGetRect(`#uv-waterfall-${i}`);
|
|
157
|
+
rectArr.push({ ...rect, name: i });
|
|
158
|
+
}
|
|
159
|
+
let item = this.tempList[0]
|
|
160
|
+
// 因为经过上面两个await节点查询和定时器,数组有可能会变成空[],导致item的值为undefined
|
|
161
|
+
// 解决多次快速滚动会导致数据乱的问题
|
|
162
|
+
if (!item) return
|
|
163
|
+
const minCol = this.getMin(rectArr);
|
|
164
|
+
// 列宽可能使用的到
|
|
165
|
+
item.width = minCol.width;
|
|
166
|
+
this[`list${minCol.name}`].push(item);
|
|
167
|
+
emitList.name = `list${minCol.name}`;
|
|
168
|
+
emitList.value = item;
|
|
169
|
+
this.$emit('changeList', emitList);
|
|
170
|
+
// 移除临时数组中已处理的数据
|
|
171
|
+
this.tempList.splice(0, 1)
|
|
172
|
+
// 如果还有数据则继续执行
|
|
173
|
+
if (this.tempList.length) {
|
|
174
|
+
let _timeout = this.addTime;
|
|
175
|
+
// 部分平台在延时较短的情况会出现BUG
|
|
176
|
+
// #ifdef MP-BAIDU
|
|
177
|
+
_timeout = _timeout < 200 ? 200 : _timeout;
|
|
178
|
+
// #endif
|
|
179
|
+
await this.$uv.sleep(_timeout);
|
|
180
|
+
this.splitData()
|
|
181
|
+
} else {
|
|
182
|
+
this.$emit('finish')
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
getMin(arr) {
|
|
186
|
+
let result = null;
|
|
187
|
+
const filter = arr.filter(item => item.height == 0);
|
|
188
|
+
if (!filter.length) {
|
|
189
|
+
const min = Math.min.apply(Math, arr.map(item => {
|
|
190
|
+
return item.height;
|
|
191
|
+
}))
|
|
192
|
+
const [item] = arr.filter(item => item.height == min);
|
|
193
|
+
result = item;
|
|
194
|
+
} else {
|
|
195
|
+
let newArr = [];
|
|
196
|
+
arr.map((item, index) => {
|
|
197
|
+
newArr.push({ len: this[`list${index+1}`].length, item: item });
|
|
198
|
+
});
|
|
199
|
+
const minLen = Math.min.apply(Math, newArr.map(item => {
|
|
200
|
+
return item.len;
|
|
201
|
+
}))
|
|
202
|
+
try {
|
|
203
|
+
const { item } = newArr.find(item => item.len == minLen && item.item.height == 0);
|
|
204
|
+
result = item;
|
|
205
|
+
} catch (e) {
|
|
206
|
+
const { item } = newArr.find(item => item.item.height == 0);
|
|
207
|
+
result = item;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return result;
|
|
211
|
+
},
|
|
212
|
+
// 清空数据列表
|
|
213
|
+
async clear() {
|
|
214
|
+
// 清除数据
|
|
215
|
+
for (let i = 0; i < this.columnCount; i++) {
|
|
216
|
+
this[`list${i+1}`] = [];
|
|
217
|
+
}
|
|
218
|
+
// #ifdef VUE2
|
|
219
|
+
this.$emit('input', [])
|
|
220
|
+
// #endif
|
|
221
|
+
// #ifdef VUE3
|
|
222
|
+
this.$emit('update:modelValue', [])
|
|
223
|
+
// #endif
|
|
224
|
+
this.tempList = []
|
|
225
|
+
await this.$uv.sleep(300);
|
|
226
|
+
this.$emit('clear');
|
|
227
|
+
},
|
|
228
|
+
// 清除指定的某一条数据,根据id来实现
|
|
229
|
+
remove(id) {
|
|
230
|
+
let index = -1
|
|
231
|
+
// 删除组件数据
|
|
232
|
+
for (let i = 1; i <= this.columnCount; i++) {
|
|
233
|
+
index = this[`list${i}`].findIndex(item => item[this.idKey] == id)
|
|
234
|
+
if (index != -1) {
|
|
235
|
+
this[`list${i}`].splice(index, 1)
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
// 同时删除父组件对应的数据
|
|
239
|
+
// #ifdef VUE2
|
|
240
|
+
index = this.value.findIndex(item => item[this.idKey] == id)
|
|
241
|
+
if (index != -1) this.$emit('input', this.value.splice(index, 1))
|
|
242
|
+
// #endif
|
|
243
|
+
// #ifdef VUE3
|
|
244
|
+
index = this.modelValue.findIndex(item => item[this.idKey] == id)
|
|
245
|
+
if (index != -1) this.$emit('update:modelValue', this.modelValue.splice(index, 1))
|
|
246
|
+
// #endif
|
|
247
|
+
this.$emit('remove', id);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
</script>
|
|
252
|
+
<style lang="scss" scoped>
|
|
253
|
+
@import '../../libs/css/components.scss';
|
|
254
|
+
.uv-waterfall {
|
|
255
|
+
@include flex(row);
|
|
256
|
+
align-items: flex-start;
|
|
257
|
+
&__column {
|
|
258
|
+
@include flex(column);
|
|
259
|
+
flex: 1;
|
|
260
|
+
// #ifndef APP-NVUE
|
|
261
|
+
height: auto;
|
|
262
|
+
// #endif
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
</style>
|
package/index.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// 全局挂载引入http相关请求拦截插件
|
|
2
|
+
import Request from './libs/luch-request'
|
|
3
|
+
|
|
4
|
+
// 引入全局mixin
|
|
5
|
+
import mixin from './libs/mixin/mixin.js'
|
|
6
|
+
// 小程序特有的mixin
|
|
7
|
+
import mpMixin from './libs/mixin/mpMixin.js'
|
|
8
|
+
// #ifdef MP
|
|
9
|
+
import mpShare from './libs/mixin/mpShare.js'
|
|
10
|
+
// #endif
|
|
11
|
+
|
|
12
|
+
// 路由封装
|
|
13
|
+
import route from './libs/util/route.js'
|
|
14
|
+
// 公共工具函数
|
|
15
|
+
import * as index from './libs/function/index.js'
|
|
16
|
+
// 防抖方法
|
|
17
|
+
import debounce from './libs/function/debounce.js'
|
|
18
|
+
// 节流方法
|
|
19
|
+
import throttle from './libs/function/throttle.js'
|
|
20
|
+
// 规则检验
|
|
21
|
+
import * as test from './libs/function/test.js'
|
|
22
|
+
|
|
23
|
+
// 颜色渐变相关,colorGradient-颜色渐变,hexToRgb-十六进制颜色转rgb颜色,rgbToHex-rgb转十六进制
|
|
24
|
+
import * as colorGradient from './libs/function/colorGradient.js'
|
|
25
|
+
|
|
26
|
+
// 配置信息
|
|
27
|
+
import config from './libs/config/config.js'
|
|
28
|
+
// 平台
|
|
29
|
+
import platform from './libs/function/platform'
|
|
30
|
+
// 压缩
|
|
31
|
+
import compress from './libs/function/compress'
|
|
32
|
+
|
|
33
|
+
const $uv = {
|
|
34
|
+
route,
|
|
35
|
+
config,
|
|
36
|
+
test,
|
|
37
|
+
compress,
|
|
38
|
+
date: index.timeFormat, // 另名date
|
|
39
|
+
...index,
|
|
40
|
+
colorGradient: colorGradient.colorGradient,
|
|
41
|
+
hexToRgb: colorGradient.hexToRgb,
|
|
42
|
+
rgbToHex: colorGradient.rgbToHex,
|
|
43
|
+
colorToRgba: colorGradient.colorToRgba,
|
|
44
|
+
http: new Request(),
|
|
45
|
+
debounce,
|
|
46
|
+
throttle,
|
|
47
|
+
platform,
|
|
48
|
+
mixin,
|
|
49
|
+
mpMixin
|
|
50
|
+
}
|
|
51
|
+
uni.$uv = $uv;
|
|
52
|
+
const install = (Vue,options={}) => {
|
|
53
|
+
// #ifndef APP-NVUE
|
|
54
|
+
const cloneMixin = index.deepClone(mixin);
|
|
55
|
+
delete cloneMixin?.props?.customClass;
|
|
56
|
+
delete cloneMixin?.props?.customStyle;
|
|
57
|
+
Vue.mixin(cloneMixin);
|
|
58
|
+
// #ifdef MP
|
|
59
|
+
if(options.mpShare){
|
|
60
|
+
Vue.mixin(mpShare);
|
|
61
|
+
}
|
|
62
|
+
// #endif
|
|
63
|
+
// #endif
|
|
64
|
+
// #ifdef VUE2
|
|
65
|
+
// 时间格式化,同时两个名称,date和timeFormat
|
|
66
|
+
Vue.filter('timeFormat', (timestamp, format) => uni.$uv.timeFormat(timestamp, format));
|
|
67
|
+
Vue.filter('date', (timestamp, format) => uni.$uv.timeFormat(timestamp, format));
|
|
68
|
+
// 将多久以前的方法,注入到全局过滤器
|
|
69
|
+
Vue.filter('timeFrom', (timestamp, format) => uni.$uv.timeFrom(timestamp, format));
|
|
70
|
+
// 同时挂载到uni和Vue.prototype中
|
|
71
|
+
// #ifndef APP-NVUE
|
|
72
|
+
// 只有vue,挂载到Vue.prototype才有意义,因为nvue中全局Vue.prototype和Vue.mixin是无效的
|
|
73
|
+
Vue.prototype.$uv = $uv;
|
|
74
|
+
// #endif
|
|
75
|
+
// #endif
|
|
76
|
+
// #ifdef VUE3
|
|
77
|
+
Vue.config.globalProperties.$uv = $uv;
|
|
78
|
+
// #endif
|
|
79
|
+
}
|
|
80
|
+
export default {
|
|
81
|
+
install
|
|
82
|
+
}
|
package/index.scss
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// 此版本发布于2024-01-24
|
|
2
|
+
const version = '1.1.20';
|
|
3
|
+
|
|
4
|
+
// 开发环境才提示,生产环境不会提示
|
|
5
|
+
if (process.env.NODE_ENV === 'development') {
|
|
6
|
+
console.log(`\n %c uvui V${version} https://www.uvui.cn/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0; border-radius: 5px;');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
v: version,
|
|
11
|
+
version,
|
|
12
|
+
// 主题名称
|
|
13
|
+
type: [
|
|
14
|
+
'primary',
|
|
15
|
+
'success',
|
|
16
|
+
'info',
|
|
17
|
+
'error',
|
|
18
|
+
'warning'
|
|
19
|
+
],
|
|
20
|
+
// 颜色部分,本来可以通过scss的:export导出供js使用,但是奈何nvue不支持
|
|
21
|
+
color: {
|
|
22
|
+
'uv-primary': '#2979ff',
|
|
23
|
+
'uv-warning': '#ff9900',
|
|
24
|
+
'uv-success': '#19be6b',
|
|
25
|
+
'uv-error': '#fa3534',
|
|
26
|
+
'uv-info': '#909399',
|
|
27
|
+
'uv-main-color': '#303133',
|
|
28
|
+
'uv-content-color': '#606266',
|
|
29
|
+
'uv-tips-color': '#909399',
|
|
30
|
+
'uv-light-color': '#c0c4cc'
|
|
31
|
+
},
|
|
32
|
+
// 默认单位,可以通过配置为rpx,那么在用于传入组件大小参数为数值时,就默认为rpx
|
|
33
|
+
unit: 'px'
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
$uv-main-color: #303133 !default;
|
|
2
|
+
$uv-content-color: #606266 !default;
|
|
3
|
+
$uv-tips-color: #909193 !default;
|
|
4
|
+
$uv-light-color: #c0c4cc !default;
|
|
5
|
+
$uv-border-color: #dadbde !default;
|
|
6
|
+
$uv-bg-color: #f3f4f6 !default;
|
|
7
|
+
$uv-disabled-color: #c8c9cc !default;
|
|
8
|
+
|
|
9
|
+
$uv-primary: #3c9cff !default;
|
|
10
|
+
$uv-primary-dark: #398ade !default;
|
|
11
|
+
$uv-primary-disabled: #9acafc !default;
|
|
12
|
+
$uv-primary-light: #ecf5ff !default;
|
|
13
|
+
|
|
14
|
+
$uv-warning: #f9ae3d !default;
|
|
15
|
+
$uv-warning-dark: #f1a532 !default;
|
|
16
|
+
$uv-warning-disabled: #f9d39b !default;
|
|
17
|
+
$uv-warning-light: #fdf6ec !default;
|
|
18
|
+
|
|
19
|
+
$uv-success: #5ac725 !default;
|
|
20
|
+
$uv-success-dark: #53c21d !default;
|
|
21
|
+
$uv-success-disabled: #a9e08f !default;
|
|
22
|
+
$uv-success-light: #f5fff0;
|
|
23
|
+
|
|
24
|
+
$uv-error: #f56c6c !default;
|
|
25
|
+
$uv-error-dark: #e45656 !default;
|
|
26
|
+
$uv-error-disabled: #f7b2b2 !default;
|
|
27
|
+
$uv-error-light: #fef0f0 !default;
|
|
28
|
+
|
|
29
|
+
$uv-info: #909399 !default;
|
|
30
|
+
$uv-info-dark: #767a82 !default;
|
|
31
|
+
$uv-info-disabled: #c4c6c9 !default;
|
|
32
|
+
$uv-info-light: #f4f4f5 !default;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// 超出行数,自动显示行尾省略号,最多5行
|
|
2
|
+
// 来自uvui的温馨提示:当您在控制台看到此报错,说明需要在App.vue的style标签加上【lang="scss"】
|
|
3
|
+
@for $i from 1 through 5 {
|
|
4
|
+
.uv-line-#{$i} {
|
|
5
|
+
/* #ifdef APP-NVUE */
|
|
6
|
+
// nvue下,可以直接使用lines属性,这是weex特有样式
|
|
7
|
+
lines: $i;
|
|
8
|
+
text-overflow: ellipsis;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
flex: 1;
|
|
11
|
+
/* #endif */
|
|
12
|
+
|
|
13
|
+
/* #ifndef APP-NVUE */
|
|
14
|
+
// vue下,单行和多行显示省略号需要单独处理
|
|
15
|
+
@if $i == '1' {
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
text-overflow: ellipsis;
|
|
19
|
+
} @else {
|
|
20
|
+
display: -webkit-box!important;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
word-break: break-all;
|
|
24
|
+
-webkit-line-clamp: $i;
|
|
25
|
+
-webkit-box-orient: vertical!important;
|
|
26
|
+
}
|
|
27
|
+
/* #endif */
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
$uv-bordercolor: #dadbde;
|
|
31
|
+
@if variable-exists(uv-border-color) {
|
|
32
|
+
$uv-bordercolor: $uv-border-color;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 此处加上!important并非随意乱用,而是因为目前*.nvue页面编译到H5时,
|
|
36
|
+
// App.vue的样式会被uni-app的view元素的自带border属性覆盖,导致无效
|
|
37
|
+
// 综上,这是uni-app的缺陷导致我们为了多端兼容,而必须要加上!important
|
|
38
|
+
// 移动端兼容性较好,直接使用0.5px去实现细边框,不使用伪元素形式实现
|
|
39
|
+
.uv-border {
|
|
40
|
+
border-width: 0.5px!important;
|
|
41
|
+
border-color: $uv-bordercolor!important;
|
|
42
|
+
border-style: solid;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.uv-border-top {
|
|
46
|
+
border-top-width: 0.5px!important;
|
|
47
|
+
border-color: $uv-bordercolor!important;
|
|
48
|
+
border-top-style: solid;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.uv-border-left {
|
|
52
|
+
border-left-width: 0.5px!important;
|
|
53
|
+
border-color: $uv-bordercolor!important;
|
|
54
|
+
border-left-style: solid;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.uv-border-right {
|
|
58
|
+
border-right-width: 0.5px!important;
|
|
59
|
+
border-color: $uv-bordercolor!important;
|
|
60
|
+
border-right-style: solid;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.uv-border-bottom {
|
|
64
|
+
border-bottom-width: 0.5px!important;
|
|
65
|
+
border-color: $uv-bordercolor!important;
|
|
66
|
+
border-bottom-style: solid;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.uv-border-top-bottom {
|
|
70
|
+
border-top-width: 0.5px!important;
|
|
71
|
+
border-bottom-width: 0.5px!important;
|
|
72
|
+
border-color: $uv-bordercolor!important;
|
|
73
|
+
border-top-style: solid;
|
|
74
|
+
border-bottom-style: solid;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// 去除button的所有默认样式,让其表现跟普通的view、text元素一样
|
|
78
|
+
.uv-reset-button {
|
|
79
|
+
padding: 0;
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
/* #ifndef APP-PLUS */
|
|
82
|
+
font-size: inherit;
|
|
83
|
+
line-height: inherit;
|
|
84
|
+
color: inherit;
|
|
85
|
+
/* #endif */
|
|
86
|
+
/* #ifdef APP-NVUE */
|
|
87
|
+
border-width: 0;
|
|
88
|
+
/* #endif */
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* #ifndef APP-NVUE */
|
|
92
|
+
.uv-reset-button::after {
|
|
93
|
+
border: none;
|
|
94
|
+
}
|
|
95
|
+
/* #endif */
|
|
96
|
+
|
|
97
|
+
.uv-hover-class {
|
|
98
|
+
opacity: 0.7;
|
|
99
|
+
}
|
|
100
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@mixin flex($direction: row) {
|
|
2
|
+
/* #ifndef APP-NVUE */
|
|
3
|
+
display: flex;
|
|
4
|
+
/* #endif */
|
|
5
|
+
flex-direction: $direction;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* #ifndef APP-NVUE */
|
|
9
|
+
// 由于uvui是基于nvue环境进行开发的,此环境中普通元素默认为flex-direction: column;
|
|
10
|
+
// 所以在非nvue中,需要对元素进行重置为flex-direction: column; 否则可能会表现异常
|
|
11
|
+
$uvui-nvue-style: true !default;
|
|
12
|
+
@if $uvui-nvue-style == true {
|
|
13
|
+
view, scroll-view, swiper-item {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
flex-grow: 0;
|
|
18
|
+
flex-basis: auto;
|
|
19
|
+
align-items: stretch;
|
|
20
|
+
align-content: flex-start;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/* #endif */
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// 超出行数,自动显示行尾省略号,最多5行
|
|
2
|
+
// 来自uvui的温馨提示:当您在控制台看到此报错,说明需要在App.vue的style标签加上【lang="scss"】
|
|
3
|
+
@if variable-exists(show-lines) {
|
|
4
|
+
@for $i from 1 through 5 {
|
|
5
|
+
.uv-line-#{$i} {
|
|
6
|
+
/* #ifdef APP-NVUE */
|
|
7
|
+
// nvue下,可以直接使用lines属性,这是weex特有样式
|
|
8
|
+
lines: $i;
|
|
9
|
+
text-overflow: ellipsis;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
flex: 1;
|
|
12
|
+
/* #endif */
|
|
13
|
+
|
|
14
|
+
/* #ifndef APP-NVUE */
|
|
15
|
+
// vue下,单行和多行显示省略号需要单独处理
|
|
16
|
+
@if $i == '1' {
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
} @else {
|
|
21
|
+
display: -webkit-box!important;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
text-overflow: ellipsis;
|
|
24
|
+
word-break: break-all;
|
|
25
|
+
-webkit-line-clamp: $i;
|
|
26
|
+
-webkit-box-orient: vertical!important;
|
|
27
|
+
}
|
|
28
|
+
/* #endif */
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
@if variable-exists(show-border) {
|
|
33
|
+
$uv-bordercolor: #dadbde;
|
|
34
|
+
@if variable-exists(uv-border-color) {
|
|
35
|
+
$uv-bordercolor: $uv-border-color;
|
|
36
|
+
}
|
|
37
|
+
// 此处加上!important并非随意乱用,而是因为目前*.nvue页面编译到H5时,
|
|
38
|
+
// App.vue的样式会被uni-app的view元素的自带border属性覆盖,导致无效
|
|
39
|
+
// 综上,这是uni-app的缺陷导致我们为了多端兼容,而必须要加上!important
|
|
40
|
+
// 移动端兼容性较好,直接使用0.5px去实现细边框,不使用伪元素形式实现
|
|
41
|
+
@if variable-exists(show-border-surround) {
|
|
42
|
+
.uv-border {
|
|
43
|
+
border-width: 0.5px!important;
|
|
44
|
+
border-color: $uv-bordercolor!important;
|
|
45
|
+
border-style: solid;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
@if variable-exists(show-border-top) {
|
|
49
|
+
.uv-border-top {
|
|
50
|
+
border-top-width: 0.5px!important;
|
|
51
|
+
border-color: $uv-bordercolor!important;
|
|
52
|
+
border-top-style: solid;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
@if variable-exists(show-border-left) {
|
|
56
|
+
.uv-border-left {
|
|
57
|
+
border-left-width: 0.5px!important;
|
|
58
|
+
border-color: $uv-bordercolor!important;
|
|
59
|
+
border-left-style: solid;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
@if variable-exists(show-border-right) {
|
|
63
|
+
.uv-border-right {
|
|
64
|
+
border-right-width: 0.5px!important;
|
|
65
|
+
border-color: $uv-bordercolor!important;
|
|
66
|
+
border-right-style: solid;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
@if variable-exists(show-border-bottom) {
|
|
70
|
+
.uv-border-bottom {
|
|
71
|
+
border-bottom-width: 0.5px!important;
|
|
72
|
+
border-color: $uv-bordercolor!important;
|
|
73
|
+
border-bottom-style: solid;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
@if variable-exists(show-border-top-bottom) {
|
|
77
|
+
.uv-border-top-bottom {
|
|
78
|
+
border-top-width: 0.5px!important;
|
|
79
|
+
border-bottom-width: 0.5px!important;
|
|
80
|
+
border-color: $uv-bordercolor!important;
|
|
81
|
+
border-top-style: solid;
|
|
82
|
+
border-bottom-style: solid;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
@if variable-exists(show-reset-button) {
|
|
87
|
+
// 去除button的所有默认样式,让其表现跟普通的view、text元素一样
|
|
88
|
+
.uv-reset-button {
|
|
89
|
+
padding: 0;
|
|
90
|
+
background-color: transparent;
|
|
91
|
+
/* #ifndef APP-PLUS */
|
|
92
|
+
font-size: inherit;
|
|
93
|
+
line-height: inherit;
|
|
94
|
+
color: inherit;
|
|
95
|
+
/* #endif */
|
|
96
|
+
/* #ifdef APP-NVUE */
|
|
97
|
+
border-width: 0;
|
|
98
|
+
/* #endif */
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* #ifndef APP-NVUE */
|
|
102
|
+
.uv-reset-button::after {
|
|
103
|
+
border: none;
|
|
104
|
+
}
|
|
105
|
+
/* #endif */
|
|
106
|
+
}
|
|
107
|
+
@if variable-exists(show-hover) {
|
|
108
|
+
.uv-hover-class {
|
|
109
|
+
opacity: 0.7;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// 历遍生成4个方向的底部安全区
|
|
2
|
+
@each $d in top, right, bottom, left {
|
|
3
|
+
.uv-safe-area-inset-#{$d} {
|
|
4
|
+
padding-#{$d}: 0;
|
|
5
|
+
padding-#{$d}: constant(safe-area-inset-#{$d});
|
|
6
|
+
padding-#{$d}: env(safe-area-inset-#{$d});
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//提升H5端uni.toast()的层级,避免被uvui的modal等遮盖
|
|
11
|
+
/* #ifdef H5 */
|
|
12
|
+
uni-toast {
|
|
13
|
+
z-index: 10090;
|
|
14
|
+
}
|
|
15
|
+
uni-toast .uni-toast {
|
|
16
|
+
z-index: 10090;
|
|
17
|
+
}
|
|
18
|
+
/* #endif */
|
|
19
|
+
|
|
20
|
+
// 隐藏scroll-view的滚动条
|
|
21
|
+
::-webkit-scrollbar {
|
|
22
|
+
display: none;
|
|
23
|
+
width: 0 !important;
|
|
24
|
+
height: 0 !important;
|
|
25
|
+
-webkit-appearance: none;
|
|
26
|
+
background: transparent;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
$uvui-nvue-style: true !default;
|
|
30
|
+
@if $uvui-nvue-style == false {
|
|
31
|
+
view, scroll-view, swiper-item {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
flex-grow: 0;
|
|
36
|
+
flex-basis: auto;
|
|
37
|
+
align-items: stretch;
|
|
38
|
+
align-content: flex-start;
|
|
39
|
+
}
|
|
40
|
+
}
|