cube-ui按钮配合toast单例模式应用


<template>
  <div>
    <cube-button icon="cubeic-right" @click="goNext">Button With Icon</cube-button>
  </div>
</template>

<script> export default { methods:{ goNext(){ const toast = this.$createToast({ txt: 'Loading...', // 提示信息
 type: 'correct', // type 字段决定了 Toast 的显示图标类型 txt纯文本常用
 time: 3000, // 显示时间长短
 maskClosable: true, // 点击蒙层是否隐藏
 mask: true // mask 设置为 true 时会显示遮罩
 }) toast.show() // 实例方法(显示)
 setTimeout(() => { toast.hide() // 实例方法(隐藏)加setTimeout原有 + 1s
 console.log(11111) // 11111
 }, 2000) } } } </script>

<style>

</style>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM