D2Admin 1.7

Former-commit-id: 3010ce31114fdc121006451c72f9e18306239fd2
This commit is contained in:
liyang
2019-05-07 09:26:18 +08:00
parent 46bc6ca451
commit d07d15ed8c
952 changed files with 171232 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import store from '@/store'
import util from '@/libs/util'
export default {
install (Vue, options) {
// 快速打印 log
Vue.prototype.$log = {
...util.log,
push (data) {
if (typeof data === 'string') {
// 如果传递来的数据是字符串
// 赋值给 message 字段
// 为了方便使用
// eg: this.$log.push('foo text')
store.dispatch('d2admin/log/push', {
message: data
})
} else if (typeof data === 'object') {
// 如果传递来的数据是对象
store.dispatch('d2admin/log/push', data)
}
}
}
}
}