This commit is contained in:
hupeng
2023-10-11 11:27:47 +08:00
commit d0b337c596
659 changed files with 67106 additions and 0 deletions

View File

@ -0,0 +1,9 @@
## 1.0.32023-07-02
uv-overlay 由于弹出层uv-transition的修改组件内部做了相应的修改参数不变。
## 1.0.22023-06-29
1. 优化H5端禁止穿透滚动
## 1.0.12023-05-16
1. 优化组件依赖,修改后无需全局引入,组件导入即可使用
2. 优化部分功能
## 1.0.02023-05-10
1. 新增uv-overlay组件

View File

@ -0,0 +1,25 @@
export default {
props: {
// 是否显示遮罩
show: {
type: Boolean,
default: false
},
// 层级z-index
zIndex: {
type: [String, Number],
default: 10070
},
// 遮罩的过渡时间单位为ms
duration: {
type: [String, Number],
default: 300
},
// 不透明度值当做rgba的第四个参数
opacity: {
type: [String, Number],
default: 0.5
},
...uni.$uv?.props?.overlay
}
}

View File

@ -0,0 +1,85 @@
<template>
<uv-transition
:show="show"
mode="fade"
custom-class="uv-overlay"
:duration="duration"
:custom-style="overlayStyle"
@click="clickHandler"
@touchmove.stop.prevent="clear"
>
<slot />
</uv-transition>
</template>
<script>
import mpMixin from '@/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js'
import mixin from '@/uni_modules/uv-ui-tools/libs/mixin/mixin.js'
import props from './props.js';
/**
* overlay 遮罩
* @description 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
* @tutorial https://www.uvui.cn/components/overlay.html
* @property {Boolean} show 是否显示遮罩(默认 false
* @property {String | Number} zIndex zIndex 层级(默认 10070
* @property {String | Number} duration 动画时长,单位毫秒(默认 300
* @property {String | Number} opacity 不透明度值当做rgba的第四个参数 (默认 0.5
* @property {Object} customStyle 定义需要用到的外部样式
* @event {Function} click 点击遮罩发送事件
* @example <uv-overlay :show="show" @click="show = false"></uv-overlay>
*/
export default {
name: "uv-overlay",
emits: ['click'],
mixins: [mpMixin, mixin, props],
watch: {
show(newVal){
// #ifdef H5
if(newVal){
document.querySelector('body').style.overflow = 'hidden';
}else{
document.querySelector('body').style.overflow = '';
}
// #endif
}
},
computed: {
overlayStyle() {
const style = {
position: 'fixed',
top: 0,
left: 0,
right: 0,
zIndex: this.zIndex,
bottom: 0,
'background-color': `rgba(0, 0, 0, ${this.opacity})`
}
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle))
}
},
methods: {
clickHandler() {
this.$emit('click')
},
clear() {}
}
}
</script>
<style lang="scss" scoped>
/* #ifndef APP-NVUE */
$uv-overlay-top:0 !default;
$uv-overlay-left:0 !default;
$uv-overlay-width:100% !default;
$uv-overlay-height:100% !default;
$uv-overlay-background-color:rgba(0, 0, 0, .7) !default;
.uv-overlay {
position: fixed;
top:$uv-overlay-top;
left:$uv-overlay-left;
width: $uv-overlay-width;
height:$uv-overlay-height;
background-color:$uv-overlay-background-color;
}
/* #endif */
</style>

View File

@ -0,0 +1,88 @@
{
"id": "uv-overlay",
"displayName": "uv-overlay 遮罩层 全面兼容小程序、nvue、vue2、vue3等多端",
"version": "1.0.3",
"description": "uv-overlay 创建一个遮罩层用于强调特定的页面元素并阻止用户对遮罩下层的内容进行操作一般用于弹窗场景uv-popup、uv-toast、uv-tooltip等组件就是用了该组件。",
"keywords": [
"uv-overlay",
"uvui",
"uv-ui",
"overlay",
"遮罩层"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [
"uv-ui-tools",
"uv-transition"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@ -0,0 +1,11 @@
## Overlay 遮罩层
> **组件名uv-overlay**
创建一个遮罩层用于强调特定的页面元素并阻止用户对遮罩下层的内容进行操作一般用于弹窗场景uv-popup、uv-toast、uv-tooltip等组件就是用了该组件。
### <a href="https://www.uvui.cn/components/overlay.html" target="_blank">查看文档</a>
### [完整示例项目下载 | 关注更多组件](https://ext.dcloud.net.cn/plugin?name=uv-ui)
#### 如使用过程中有任何问题或者您对uv-ui有一些好的建议欢迎加入 uv-ui 交流群:<a href="https://ext.dcloud.net.cn/plugin?id=12287" target="_blank">uv-ui</a>、<a href="https://www.uvui.cn/components/addQQGroup.html" target="_blank">官方QQ群</a>