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