Toast
this.$toast
预览
代码
<style>
.gulu-toast{
z-index: 30 !important
}
</style>
<g-button @click="$toast('点击弹出提示')">上方弹出</g-button>
<g-button @click="$toast('点击弹出提示',{position:'middle'})">中间弹出</g-button>
<g-button @click="$toast('点击弹出提示',{position:'bottom'})">下方弹出</g-button>
设置关闭按钮
预览
代码
<style>
.gulu-toast{
z-index: 30 !important
}
</style>
<g-button @click="onclickButton">上方弹出</g-button>
methods:{
onclickButton(){
this.$toast('启禀圣上,臣有事起奏',{
closeButton:{
text:'朕知道了',
callback:()=>{
console.log('圣上说准奏')
}
}
})
}
}
支持 HTML
预览
代码
<style>
.gulu-toast{
z-index: 30 !important
}
</style>
<g-button @click="onclickButton">上方弹出</g-button>
methods:{
onclickButton(){
this.$toast('<strong style="color:red;">加粗提示</strong>',{
enableHtml:true
})
}
}