this.$log.push(this.text)
Former-commit-id: 68835d0d14a26c911493667952e8920533176cda [formerly 68835d0d14a26c911493667952e8920533176cda [formerly 68835d0d14a26c911493667952e8920533176cda [formerly 68835d0d14a26c911493667952e8920533176cda [formerly 36698e25123732c5ebcef3b1be4f6689a77fcc60 [formerly 0fdad5bcf43969f757bbcccb132a5876e84cba80]]]]] Former-commit-id: 75abf1504b7ee705faefdbc909e48853a31804c5 Former-commit-id: 09a29410819b4a8a9206bf8f25983ced57acc210 Former-commit-id: c9ff463b6dccc21297940c5a029880b59c073bab [formerly 9b13330a75ac199ef4d634668f3daddc23faea93] Former-commit-id: dc9f756459eb8a702f3a33729cbda50ec8a70085 Former-commit-id: 6085d6e77abf5efe9976a8414abec6524e621ac0 Former-commit-id: 2f1a97adf665f917721b92b3e8e8b7845d090e85 Former-commit-id: b739a8f5f768a0f5a864944b433f9ac6be47fe12 Former-commit-id: 139d6f73cc2c44d700276143280c56b7f34fef86
This commit is contained in:
@@ -7,7 +7,18 @@ export default {
|
||||
Vue.prototype.$log = {
|
||||
...util.log,
|
||||
push (data) {
|
||||
store.dispatch('d2admin/log/add', data)
|
||||
if (typeof data === 'string') {
|
||||
// 如果传递来的数据是字符串
|
||||
// 赋值给 message 字段
|
||||
// 为了方便使用
|
||||
// eg: this.$log.push('foo text')
|
||||
store.dispatch('d2admin/log/add', {
|
||||
message: data
|
||||
})
|
||||
} else if (typeof data === 'object') {
|
||||
// 如果传递来的数据是对象
|
||||
store.dispatch('d2admin/log/add', data)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user