-
v1.10.0 Stable
released this
2023-08-11 10:20:03 +08:00 | 42 commits to master since this releaseprops定义中的Array和Object, 改用Proxy(), 现支持对子属性的直接修改。props定义简单类型, 如String、Number、Boolean, 可以快速的定义非显式属性。
对应
3种特殊的prefix字符, 即str!、num!、bool!, 叹号后面可以带上默认值, 框架会自动按类型转换, 其中布尔类型的默认值, 除'false'和''之外, 全部为true。class Foo extends Component { static props = { foo: 'str!', // 等价于 foo: { type: String, default: '', attribute: false } bar: 'num!666', // 等价于 foo: { type: Number, default: 666, attribute: false } goo: 'bool!false' // 等价于 foo: { type: Boolean, default: false, attribute: false } } }Downloads