vant Toast 关闭时回调函数

1,064 阅读1分钟

main.js中

import {Toast} from 'vant'Vue.use(Toast)Vue.prototype.$toast = Toast

this.$toast(
    {
        message: toastMsg,   // toast 内容     
        duration: 5000 // toast显示时间   
    })   
    .$on('close',  // 关闭时回调函数    
        () => {           
            console.log(‘弹窗已关闭‘)
          })