From 0a44bf5a8f878c5fbc9d801ec5047161c434a961 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Tue, 19 Mar 2019 21:41:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E6=9C=AC=E5=9C=B0=20console=20?= =?UTF-8?q?=E5=92=8C=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=E6=B7=B7=E4=B8=BA?= =?UTF-8?q?=20$log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/plugin/log/index.js | 10 +++++----- src/views/demo/playground/log/log/index.vue | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugin/log/index.js b/src/plugin/log/index.js index 46f581fe..2be75be1 100644 --- a/src/plugin/log/index.js +++ b/src/plugin/log/index.js @@ -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) + } } } } diff --git a/src/views/demo/playground/log/log/index.vue b/src/views/demo/playground/log/log/index.vue index 4153d5dd..614e9f18 100644 --- a/src/views/demo/playground/log/log/index.vue +++ b/src/views/demo/playground/log/log/index.vue @@ -21,7 +21,7 @@ export default { }, methods: { handleAdd () { - this.$logAdd({ + this.$log.push({ message: this.text }) }