上一主题 下一主题
ScriptCat,新一代的脚本管理器脚本站,与全世界分享你的用户脚本油猴脚本开发指南教程目录
返回列表 发新帖

element框架的弹窗如何使用油猴触发?

[复制链接]
  • TA的每日心情
    开心
    2023-5-21 22:45
  • 签到天数: 1 天

    [LV.1]初来乍到

    2

    主题

    2

    回帖

    8

    积分

    助理工程师

    积分
    8
    发表于 2023-5-20 11:24:16 | 显示全部楼层 | 阅读模式
    悬赏2油猫币未解决

    本帖最后由 kqs42 于 2023-5-20 11:25 编辑

    测试网址:https://element-plus.gitee.io/zh-CN/component/notification.html
    描述:网站用的是vue3+lement-plus框架。
    需求:用油猴脚本触发网站本身的Notification通知组件。

    官方给出的示例是click触发,我想用油猴脚本直接触发。

    <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>
    

  • TA的每日心情
    开心
    2023-2-28 23:59
  • 签到天数: 191 天

    [LV.7]常住居民III

    637

    主题

    5196

    回帖

    6078

    积分

    管理员

    非物质文化遗产社会摇传承人

    积分
    6078

    荣誉开发者管理员油中2周年生态建设者喜迎中秋

    发表于 2023-5-20 13:32:08 | 显示全部楼层
    [油猴脚本开发指南]元素规则校验和检测的触发
    https://bbs.tampermonkey.net.cn/thread-1250-1-1.html
    混的人。
    ------------------------------------------
    進撃!永遠の帝国の破壊虎---李恒道

    入驻了爱发电https://afdian.net/a/lihengdao666
    个人宣言:この世界で私に胜てる人とコードはまだ生まれていません。死ぬのが怖くなければ来てください。
    回复

    使用道具 举报

    发表回复

    本版积分规则

    快速回复 返回顶部 返回列表