摘要:
filter() 对数组中的每个元素都执行一次指定的函数(callback),并且创建一个新的数组,该数组元素是所有回调函数执行时返回值为 true(return true) 的原数组元素,返回值为false(return false)的原数组元素过滤掉。它只对数组中的非空元素执行指定的函数,没有赋
阅读全文
posted @ 2021-11-12 17:55
pwindy
阅读(2546)
推荐(0)
摘要:
1.state(computed, ...mapState) 用来保存数据的 var state= { a:1 } 2.mutations(methods, ...mapMutations) 操控state里面的数据 const mutations = { addAge(state) { state
阅读全文
posted @ 2021-11-12 11:49
pwindy
阅读(213)
推荐(0)
摘要:
template 中需要动态定义样式,通常做法: <template> <div :style="{ color: textColor }">Text</div> </template> <script> export default { data() { return { textColor: '
阅读全文
posted @ 2021-11-12 11:06
pwindy
阅读(54)
推荐(0)
摘要:
1.快速转 Number var a = '1' console.log(typeof a) console.log(typeof Number(a)) // 普通写法 console.log(typeof +a) // 高端写法 2.快速转 Boolean var a = 0 console.lo
阅读全文
posted @ 2021-11-12 10:47
pwindy
阅读(51)
推荐(0)