element框架的弹窗如何使用油猴脚本触发?
以下是官方给出的click触发案例,页面依赖于VUE3
需求是在油猴脚本里触发网站本身element plus的弹窗。
<template>
<el-button plain @click="open1"> Closes automatically </el-button>
<el-button plain @click="open2"> Won't close automatically </el-button>
</template>
<script lang="ts" setup>
import { h } from 'vue'
import { ElNotification } from 'element-plus'
const open1 = () => {
ElNotification({
title: 'Title',
message: h('i', { style: 'color: teal' }, 'This is a reminder'),
})
}
const open2 = () => {
ElNotification({
title: 'Prompt',
message: 'This is a message that does not automatically close',
duration: 0,
})
}
</script>