0.1.2 • Published 2 years ago
vue-msg-hgy v0.1.2
default
使用方法
1.安装插件:npm i vue-msg-hgy
2.main.js引入资源
import vueMsg from "vue-msg-hgy";
import 'vue-msg-hgy/lib/vue-msg-hgy.css';
Vue.use(vueMsg);
3.页面引用
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<div class="content">
<input placeholder="请输入电话" v-model="tel"/>
<button @click="submit()">提交</button>
<vue-msg ref="msg"></vue-msg>
</div>
</div>
</template>
4.
data(){
return{
tel:''
}
},
5.方法调用
submit(){
if(!this.tel){
this.$nextTick(()=>{
this.$refs.msg.msgPlugins('电话不能为空',5000)
})
}
}