vue2 uses ElementUI as an example to build notify convenient and exquisite prompts

We first introduce a third-party UI library.
Here we take elementUI as an example
and introduce dependencies first.

npm install element-ui --save

Insert image description here
Then introduce it in the main.js entry file

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

Vue.use(ElementUI)

Insert image description here
Then use it in your component

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

A beautiful prompt will appear on the right side of the page.
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_45966674/article/details/132896957