0
点赞
收藏
分享

微信扫一扫

vue2以ElementUI为例构建notify便捷精美提示

数数扁桃 2023-09-21 阅读 10

我们先引入一个 第三方UI库
这里 我们以elementUI为例
先引入依赖

npm install element-ui --save

在这里插入图片描述
然后 在 main.js 入口文件中 引入一下

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

Vue.use(ElementUI)

在这里插入图片描述
然后 在组件中使用

this.$notify({
  title: '提示',
  message: '这是一条通知消息',
  type: 'success'
})

页面右侧就会出现一个精美的提示啦
在这里插入图片描述

举报

相关推荐

0 条评论