关于Vue中的porps(作者私人仓库)

156 阅读1分钟

一、

1、

2、

这意味当你使用DOM中的模板时,camelCase(驼峰命名法)的prop名需要使用其等价的kebab-case(短横线分隔命名)

3、prop类型

4、传递静态或者动态prop

5、即便数字42是静态的,我们仍然需要v-bind来告诉vue

6、

7、

8、

9、

二、单向数据流

1、

不要影响到父组件的值

三、prop验证

1、

注意那些prop会在一个组件实例被创建之前进行验证。

2、类型检查

四、非prop的Attribute

1、

2、替换/合并已有的 Attribute

绝大部分attribut会破坏掉,而class和style智能点

3、禁用 Attribute 继承