| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <template>
- <view
- class="fs-mask"
- :class="{'fs-mask-blur': blurable}"
- :style="{'zIndex': zIndex}"
- v-if="modelValue"
- @click="handleMask">
- </view>
- </template>
- <script setup>
- const props = defineProps({
- modelValue: Boolean,
- blurable: Boolean,
- zIndex: {
- type: Number,
- default: 899
- },
- maskClickable: {
- type: Boolean,
- default: true
- }
- })
- const emits = defineEmits(['update:modelValue','close'])
- const handleMask = () => {
- if (props.maskClickable) {
- emits('update:modelValue', false)
- emits('close')
- }
- }
- </script>
- <style lang="scss">
- .fs-mask{
- position: fixed;
- top: var(--window-top);
- right: 0;
- bottom: var(--window-bottom);
- left: 0;
- background-color: rgba(0, 0, 0, 0.5);
-
- &-blur{
- backdrop-filter: blur(12rpx);
- }
- }
- </style>
|