知识点积累
2019-10-14 本文已影响0人
web3d开发工程师
vue 混入

es6 字符串解构

了解到一种新的属性叫做 css安全区域,看起来貌似是ios11才有的东西
echarts 热力图的东西
echarts层级显示使用visualMap控制大小,颜色 自带设置了
当然值也要在data里面显示 例如 data:[name:'北京',value:200],这样在visualMap才能控制
如何取到数组最后一个元素
1、arr.pop()
2、arr[arr.length -1]
如果获取屏幕宽度
document.documentElement.clientWidth
chrome 花式console

#######变量打印
const text = 'chinese';
console.log("打印${text}");//
#######字符串打印

const text = 'chinese';
console.log("打印 %s", text)
对象打印

console.log("对象打印 %o", obj)

console.log("数字打印 %d", obj)
%c这里就是花式打印了
有三种好看的打印
console.log('%c Auth ',
'color: white; background-color: #2274A5',
'Login page rendered');
console.log('%c GraphQL ',
'color: white; background-color: #95B46A',
'Get user details');
console.log('%c Error ',
'color: white; background-color: #D33F49',
'Error getting user details');
对象解构打印

很简单
布尔值打印

const value = 1001
console.assert(value===1000,"value is not 1000")
测试代码执行时间
console.time('开始执行')
。。。
console.timeEnd('执行结束')
表格输出
console.table(a)
对象节点打印
console.dir()