当安装为插件时,我们可以使用加载程序来设置其全局选项吗,如下所示:

Vue.use(Loading, {
  container: null,
  isFullPage: true,
  loader: 'dots'
})

然后这样调用:

this.$loading.show()
2020-10-22 21:59创建
共1个回答
NV
游客nvRbwh

可以的。

作为插件使用时,你可以全局设置props和插槽:

Vue.use(Loading, {
  // props
  color: 'red'
},{
  // slots
})

在创建新实例时,你可以重写任何props和插槽:

let loader = Vue.$loading.show({
 color: 'blue'
},{
  // slots
});