请求处理代理
商品管理 商品分类 用户管理 桌台 代客下单 进销存 交班 预定座位 充值管理 存酒管理
This commit is contained in:
71
jeepay-ui-uapp-merchant/components/my-components/my-mask.vue
Normal file
71
jeepay-ui-uapp-merchant/components/my-components/my-mask.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<view class="mask u-fixed tranistion position-all u-flex u-flex-col u-row-center u-col-center" v-if="show"
|
||||
:style="computedStyle" @tap="maskClick">
|
||||
<view class="w-full" @tap.stop="nullFunction">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
ref
|
||||
} from 'vue';
|
||||
const props = defineProps({
|
||||
zIndex: {
|
||||
type: [Number, String]
|
||||
},
|
||||
tapClose: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
const emits = defineEmits(['close', 'toggle', 'open'])
|
||||
let show = ref(false)
|
||||
|
||||
function close() {
|
||||
show.value = false
|
||||
emits('close')
|
||||
}
|
||||
|
||||
function open() {
|
||||
show.value = true
|
||||
emits('open')
|
||||
}
|
||||
|
||||
function nullFunction() {
|
||||
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
if (show.value) {
|
||||
close()
|
||||
} else {
|
||||
open()
|
||||
}
|
||||
}
|
||||
|
||||
function maskClick() {
|
||||
if (props.tapClose) {
|
||||
close()
|
||||
}
|
||||
}
|
||||
const computedStyle = computed(() => {
|
||||
return `
|
||||
z-index:${props.zIndex};
|
||||
`
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
close,
|
||||
toggle,
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mask {
|
||||
background-color: rgba(51, 51, 51, .5);
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user