1、可用css强制修改定位,但是弊端是多个弹窗提示同时出现的时候会重叠
2、在main.js中加入以下代码内容:
const $message = option=>{
console.log(option)
return ElementUI.Message({
...option,
offset:100
})
}
['success','warning','info','error'].forEach(type=>{
$message[type]= option=>{
if(typeof option === 'string'){
option={
message:option,
offset:100
}
}
option.type = type
return ElementUI.Message(option)
}
})
Vue.use(ElementUI)
Vue.prototype.$message = $message
如果因为…报错,下载
cnpm install babel-plugin-transform-object-rest-spread