hxz-light-toast

1.0.1 • Public • Published

hxz-light-toast

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('我爱模板网 www.5imoban.net', 'info', 2000)

setup语法糖下使用

import { getCurrentInstance } from 'vue'
const instance = getCurrentInstance()

instance.proxy.$toast.show('我爱模板网 www.5imoban.net', 'info', 2000)

参数

参数名 默认值 类型 解释
str '' String 提示语
type 'info' String 提示类型:info、success、warning、error
time 2000 Number 多少秒后关闭

Package Sidebar

Install

npm i hxz-light-toast

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

75 kB

Total Files

10

Last publish

Collaborators

  • hxz141hxz