You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
559 B
22 lines
559 B
2 years ago
|
# effect的妙用
|
||
|
|
||
|
FineUI组件中text,value,cls,css,selected,items,columnSize,rowSize,invisible,disabled等属性都已经支持了响应式
|
||
|
|
||
|
但是,总有一些属性没有支持响应式,或者一些组件提供的props并未支持响应式,这时候只能回归`_store`+`watch`了吗?
|
||
|
|
||
|
非也,有effect属性
|
||
|
|
||
|
```javascript
|
||
|
const state = Fix.define({
|
||
|
state1: 0
|
||
|
});
|
||
|
const render = () => {
|
||
|
return {
|
||
|
type: "bi.my_custom_wdiget",
|
||
|
effect: (customWidget) => {
|
||
|
customWidget.customMethod(state.state1);
|
||
|
}
|
||
|
};
|
||
|
};
|
||
|
```
|