element-plus/docs/examples/tour/mask.vue

59 lines
1.4 KiB
Vue
Raw Normal View History

<template>
<el-button type="primary" @click="open = true">Begin Tour</el-button>
<el-divider />
<el-space>
<el-button ref="ref1">upload</el-button>
<el-button ref="ref2" type="primary">save</el-button>
<el-button ref="ref3" :icon="MoreFilled" />
</el-space>
<el-tour
v-model="open"
:mask="{
style: {
boxShadow: 'inset 0 0 15px #333',
},
color: 'rgba(80, 255, 255, .4)',
}"
>
<el-tour-step :target="ref1?.$el" title="Upload File">
<img
src="https://element-plus.org/images/element-plus-logo.svg"
alt="tour.png"
/>
<div>Put you files here.</div>
</el-tour-step>
<el-tour-step
:target="ref2?.$el"
title="Save"
description="Save your changes"
:mask="{
style: {
boxShadow: 'inset 0 0 15px #fff',
},
color: 'rgba(40, 0, 255, .4)',
}"
/>
<el-tour-step
:target="ref3?.$el"
title="Other Actions"
description="Click to see other"
:mask="false"
/>
</el-tour>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { type ElButton } from 'element-plus'
import { MoreFilled } from '@element-plus/icons-vue'
const ref1 = ref<InstanceType<typeof ElButton> | null>(null)
const ref2 = ref<InstanceType<typeof ElButton> | null>(null)
const ref3 = ref<InstanceType<typeof ElButton> | null>(null)
const open = ref(false)
</script>