Closed callmeYe closed 4 years ago
https://remaxjs.org/guide/implementation-notes 可以看下实现原理。
一般来说你不需要考虑 setData。就按 react 的思路来写就行了。你可以对照想象一下,当你写 react-native 的时候,你也不需要关心底层是怎么 "setData" 的
https://remaxjs.org/guide/implementation-notes 可以看下实现原理。
一般来说你不需要考虑 setData。就按 react 的思路来写就行了。你可以对照想象一下,当你写 react-native 的时候,你也不需要关心底层是怎么 "setData" 的
是的,我也不想关心底层是怎么“setData”的,但是我不知道在remax中引入的mini-ali-ui如何使用,如果参照mini-ali-ui的官方文档,那么setData就无法绕过(主要是里面setData设置的是不存在于data列表中的状态值使我很迷惑),我尝试用react的方式实现(见上面代码),但是失败了。
解决了,多谢!
问题描述 [详细地描述问题,让大家都能理解] 我在使用mini-ali-ui中的tabs组件时(https://opendocs.alipay.com/mini/component-ext/tabs),对于原生的写法如何转化为remax的写法表示非常困惑。有这样两个函数:
这里面setData中的tabsName我并没有在data中找到对应项,不知道在remax中应如何写。下面贴的代码是我尝试的写法 [如果有必要,展示代码,线上示例,或仓库]
其他信息 [如截图等其他信息可以贴在这里]