no message
Former-commit-id: 9050b9d382144bfe3ab53b012be11461e0332aba Former-commit-id: 945e9c09f433ee70768ae89a742df931dca1748f Former-commit-id: 2dc0ede52e025f6ad6be58135a579ccda3ab93ad
This commit is contained in:
18
src/plugin/log/index.js
Normal file
18
src/plugin/log/index.js
Normal file
@@ -0,0 +1,18 @@
|
||||
export default {
|
||||
install (Vue, options) {
|
||||
// 打印log
|
||||
// 如果只有一个参数 就只简单打印第一个参数
|
||||
// 如果有大于一个参数 第一个参数会当做是分组的名称
|
||||
Vue.prototype.$log = (arg1 = 'log', ...logs) => {
|
||||
if (logs.length === 0) {
|
||||
console.log(arg1)
|
||||
} else {
|
||||
console.group(arg1)
|
||||
logs.forEach(e => {
|
||||
console.log(e)
|
||||
})
|
||||
console.groupEnd()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user