将本地 console 和日志记录混为 $log

Former-commit-id: beb1f6d3b453e881cc01d07be1cd36e6b14fef32 [formerly beb1f6d3b453e881cc01d07be1cd36e6b14fef32 [formerly beb1f6d3b453e881cc01d07be1cd36e6b14fef32 [formerly beb1f6d3b453e881cc01d07be1cd36e6b14fef32 [formerly b2ec499b9466f1629e2cd965d6948298399b7736 [formerly 996423bbecb3cdeef6ca080d1b59072050aa5f1f]]]]]
Former-commit-id: 6d0621bec321b2841fbf44dc05817c12eee20595
Former-commit-id: a9703939966616751729a94aedf76f5d534438ea
Former-commit-id: b6b9410194abaa1a6eff40f11754d79870492b70 [formerly 035ee58d42005f80e0005e7ab9e2b9bcdf97aa2a]
Former-commit-id: b5ceb6ea7a1b158eaeb97fb2e3c5b8312b8c51b3
Former-commit-id: 49e3519a3a7e6ec9b08e8d2184e086c16556f5b8
Former-commit-id: 3e14916037a5913c9a1e96ebf1e355ba6c209a53
Former-commit-id: 96190b9608241a670bcd72de6d9ffda3895a3602
Former-commit-id: 3b7884de25614fe06e9de3eb10f57babcaa9ee50
This commit is contained in:
liyang
2019-03-19 21:41:56 +08:00
parent a40e069bae
commit 0a44bf5a8f
2 changed files with 6 additions and 6 deletions

View File

@@ -4,11 +4,11 @@ import util from '@/libs/util'
export default {
install (Vue, options) {
// 快速打印 log
Vue.prototype.$log = util.log
// 快速记录日志
Vue.prototype.$logAdd = function (data) {
// store 赋值
store.dispatch('d2admin/log/add', data)
Vue.prototype.$log = {
...util.log,
push (data) {
store.dispatch('d2admin/log/add', data)
}
}
}
}

View File

@@ -21,7 +21,7 @@ export default {
},
methods: {
handleAdd () {
this.$logAdd({
this.$log.push({
message: this.text
})
}