特效介绍

模仿element ui的message提示的vue3轻量级提示插件。
使用方法
安装插件
npm install hxz-light-toast --save
引用插件
import { createApp } from 'vue'
import App from './App.vue'
import hxzLightToast from 'hxz-light-toast';
import 'hxz-light-toast/dist/index.css';
const app = createApp(App)
app.use(hxzLightToast)
app.mount('#app')this语法使用
this.$toast.show('我爱模板网 5.jimth.com', 'info', 2000)setup语法糖下使用
import { getCurrentInstance } from 'vue'
const instance = getCurrentInstance()
instance.proxy.$toast.show('我爱模板网 5.jimth.com', 'info', 2000)参数
| 参数名 | 默认值 | 类型 | 解释 |
|---|---|---|---|
| str | '' | String | 提示语 |
| type | 'info' | String | 提示类型:info、success、warning、error |
| time | 2000 | Number | 多少秒后关闭 |
