I need to know, if it is possible to detect that the content of the slot of a custom component has changed.
This is my component:
//my-component.wxml
<view class = "wrapper">
<! - more code ->
<slot> </slot>
</view>
So to use it I do:
<my-component> {{userName}} </my-component>
I need to detect every time value of variable "userName" changes. This is a much simpler example, because if it were the value of a variable it would create a property on the component and create an observer.
I have searched the net a lot and have not found anything about it.
Wechat-miniprogram have no obverse if you want change the data, you can use this.setData({userName:'xxx'}).
Otherwise,if you want to obverse the datachange in view.You can use origin component "input".And bind the "change" event of "input".
The method of development is supported from offical.
If you want to use vue/react to develop your miniprogram, you must select other technology stack or frame likes wepy/taro/uniapp.