no message

Former-commit-id: 9050b9d382144bfe3ab53b012be11461e0332aba
Former-commit-id: 945e9c09f433ee70768ae89a742df931dca1748f
Former-commit-id: 2dc0ede52e025f6ad6be58135a579ccda3ab93ad
This commit is contained in:
李杨
2018-01-25 23:47:19 +08:00
parent 4bcc6e7396
commit 5e830d81e7
4 changed files with 22 additions and 14 deletions

18
src/plugin/log/index.js Normal file
View 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()
}
}
}
}