最近几天把写的项目转移到了Vue3和Element-plus遇到的一些小问题
首先定义全局方法的方式 还有引用变了
Vue3我是这么写的
export function ServerDataRequest(yourUrl) {
return this.$axios({
method: "post",
url: yourUrl,
}).then((res) => {
console.log("Request is Sucess! RequestMapping is ->\t" + yourUrl)
return res.data
}).catch(error => {
console.log("Request is error! check your server! -> \t" + error);
this.notify_messeage("数据获取失败,服务器的问题", "error")
})
}
export function colorFuntion(color) {
if (color == '晨岛') return 'blue'
if (color == '云野') return 'green'
if (color == '雨林') return 'cornflowerblue'
if (color == '墓土') return 'black'
if (color == '霞谷') return 'salmon'
if (color == '禁阁&#