watch和computed watch监听,一个影响多个用watch computed计算属性,多个影响一个用computed touchstart touchmove touchend touchcancel(系统取消事件) vue 打包找不到资源文件 config/index.js 修改build:{assetsPublicPath: ‘./’}
const bird = {
size : "small"
}
const mouse = {
name : "tom" ,
small : 3
}
//console.log ( mouse.bird.size) // 报错
console.log ( mouse[bird.size]) //3
console.log ( mouse[bird["size" ]]) // 3
比较
console.log( { age : 18} == { age : 18} ) // false
console.log( { age : 18} === { age : 18} ) // false
console.log ( Number ( 2) === Number ( 2) ) // true
console.log ( Boolean ( false) === Boolean ( false) ) // true
console.log ( Symbol ( 'foo' ) === Symbol ( 'foo' ) ) // false 每个Symbol 都是唯一的
eval
console.log ( eval ( '10*10+5' ) ) // eval会字符串传递的代码求值 105
console.log ( '10*10+5' ) // '10*10+5'
… 对象,数组都可以拼接
let user = { name : 'tom' ,age : 21}
let admin = { admin : true,...user} ;
console.log(admin) // { admin : true, name : "tom" , age : 21}