12345678910111213141516171819202122232425262728293031323334 |
- function msg(Vue) {
- Vue.prototype.$msg = function(text, type, bc, bc2, isHtml) {
- if (type === 'confirm') {
- this.$confirm(text, '提示', {
- type: 'warning',
- dangerouslyUseHTMLString: isHtml
- }).then(() => {
- if (bc) bc()
- }).catch(() => {
- if (bc2) bc2()
- })
- } else {
- this.$alert(text, '提示', {
- callback: action => {
- if (bc) bc()
- }
- })
- }
- }
- Vue.prototype.$msgs = function(message) {
- this.$message({
- message,
- type: 'success'
- })
- }
- Vue.prototype.$msgw = function(message) {
- this.$message({
- message,
- type: 'warning'
- })
- }
- }
- export default msg
|