yes
Message
I want to set showClose:true
and duration:1000
to Message's default option, so that i won't set the option of every call.
You can write your own wrapper function.
@Xcorpio 你解决这个问题了吗?
我想到一个笨办法
在 main.js 中
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
Vue.prototype.$mes = option => Vue.prototype.$message({showClose: true, ...option})
Vue.prototype.$mes.success = mes => Vue.prototype.$message.success({showClose: true, message: mes})
希望对你有帮助!
当然,如果你已经找到更好的方法,希望 @
我一下
我去, 都2020年了, 这问题还没办法啊?