在main.js中进行封装
Vue.prototype.$sleep = time => {
return new Promise((resolve, reject) => {
window.setTimeout(() => {
resolve()
}, time)
})
}
这样就可以全局当中使用了。
直接$sleep(时间参数)

相关文章:

  • 2022-12-23
  • 2021-08-18
  • 2021-11-28
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-04-27
  • 2021-09-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案