还没入门
2019-02-22
当一个组件需要获取多个状态时候,将这些状态都声明为计算属性会有些重复和冗余。为了解决这个问题,我们可以使用 mapState 辅助函数帮助我们生成计算属性。 官方文档中的说明: mapState mapState(namespace?: string, map: Array<string..
2018-12-18
原型链的基本思想是:利用原型让一个引用类型继承另一个引用类型的属性和方法。重写或添加方法的正确写法:function SuperType() { this.property = true;}SuperType.prototype.getSuperValue = func..
2018-12-16
(只记录易错转换) 一、 强制转换1. Number()(1) 原始类型值// 字符串:如果不可以被解析为数值,返回 NaNNumber('324abc') // NaN// 字符串:如果不可以被解析为数值,返回 NaNNumber('324abc') ..
2018-12-15
Due to limitations in JavaScript, Vue cannot detect the following changes to an array: When you directly set an item with the index, e.g. vm.items[..
2018-12-10
v-if vs v-showV-if is “real” and lazy: The event and child components inside the conditional block are properly destroyed and re-created during the..
2018-12-09
In the most cases, their performances are the same. However, in some instances just like: computed: { now: function(){ return Date.now();..