|
|
@ -1,6 +1,7 @@ |
|
|
import Vue from 'vue'; |
|
|
import Vue from 'vue'; |
|
|
import Element from 'element-ui'; |
|
|
import Element from 'element-ui'; |
|
|
Vue.use(Element, { size: 'small', zIndex: 1000 }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vue.use(Element, {size: 'small', zIndex: 1000}); |
|
|
import { |
|
|
import { |
|
|
Pagination, |
|
|
Pagination, |
|
|
Dialog, |
|
|
Dialog, |
|
|
@ -144,14 +145,13 @@ Vue.prototype.$prompt = MessageBox.prompt; |
|
|
Vue.prototype.$notify = Notification; |
|
|
Vue.prototype.$notify = Notification; |
|
|
Vue.prototype.$message = Message; |
|
|
Vue.prototype.$message = Message; |
|
|
|
|
|
|
|
|
Vue.prototype.$ELEMENT = { size: 'medium' } |
|
|
|
|
|
|
|
|
Vue.prototype.$ELEMENT = {size: 'medium'} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vue.prototype.$message = function (msg) { |
|
|
Vue.prototype.$message = function (msg) { |
|
|
//根据msg对象中的type类型判断消息提示的类型
|
|
|
|
|
|
let msgObj = { |
|
|
let msgObj = { |
|
|
message: msg.message ? msg.message : msg, |
|
|
message: msg.message ? msg.message : msg, |
|
|
duration: 3000 |
|
|
|
|
|
|
|
|
duration: 2000 |
|
|
} |
|
|
} |
|
|
let msgType = msg.type || "" |
|
|
let msgType = msg.type || "" |
|
|
switch (msgType) { |
|
|
switch (msgType) { |
|
|
@ -169,32 +169,28 @@ Vue.prototype.$message = function (msg) { |
|
|
|
|
|
|
|
|
default: |
|
|
default: |
|
|
return Message(msgObj); |
|
|
return Message(msgObj); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//分别对success、warning ,error info等样式进行设置
|
|
|
|
|
|
|
|
|
|
|
|
Vue.prototype.$message.success = function (msg) { |
|
|
Vue.prototype.$message.success = function (msg) { |
|
|
return Message.success({ |
|
|
return Message.success({ |
|
|
message: msg, |
|
|
message: msg, |
|
|
duration: 1000 |
|
|
duration: 1000 |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Vue.prototype.$message.warning = function (msg) { |
|
|
Vue.prototype.$message.warning = function (msg) { |
|
|
return Message.warning({ |
|
|
return Message.warning({ |
|
|
message: msg, |
|
|
message: msg, |
|
|
duration: 1000 |
|
|
duration: 1000 |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Vue.prototype.$message.error = function (msg) { |
|
|
Vue.prototype.$message.error = function (msg) { |
|
|
return Message.error({ |
|
|
return Message.error({ |
|
|
message: msg, |
|
|
message: msg, |
|
|
duration: 1500 |
|
|
duration: 1500 |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
Vue.prototype.$message.info = function (msg) { |
|
|
|
|
|
return Message.info({ |
|
|
|
|
|
message: msg, |
|
|
|
|
|
duration: 1000 |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|