You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
问题描述:在设计组件的时候没有过多的去考虑不同用户身份带来的渲染组件不同,而是将所有的代码扁平化实现(即所有细节都在一个组件内部)在userCard,带来的弊端是有太多冗余的html代码以及css样式不好维护。
以后解决方式:一个组件仍然可以进行更细化的拆分,但是因为wepy不能导入全局scss,那么过多的进行组件化也会带来重复的scss代码。这一点就导致了我不想去做更多的组件化。为了代码美观而大量牺牲性能不太可取。
偏向于React的JSX语法,将一些html片段(比组件更细节的代码,可以理解为组件内部的子组件)封装到函数返回值内,然后通过render()进行调用,这样的方式很优雅。
The text was updated successfully, but these errors were encountered: