Skip to content
This repository was archived by the owner on Jan 19, 2023. It is now read-only.
This repository was archived by the owner on Jan 19, 2023. It is now read-only.

[Bad Smell] UserCard module 组件化拆分问题 #12

@ACERY1

Description

@ACERY1

问题描述:在设计组件的时候没有过多的去考虑不同用户身份带来的渲染组件不同,而是将所有的代码扁平化实现(即所有细节都在一个组件内部)在userCard,带来的弊端是有太多冗余的html代码以及css样式不好维护。

以后解决方式:一个组件仍然可以进行更细化的拆分,但是因为wepy不能导入全局scss,那么过多的进行组件化也会带来重复的scss代码。这一点就导致了我不想去做更多的组件化。为了代码美观而大量牺牲性能不太可取。

偏向于React的JSX语法,将一些html片段(比组件更细节的代码,可以理解为组件内部的子组件)封装到函数返回值内,然后通过render()进行调用,这样的方式很优雅。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Shit SmellThe Bad Smell Of Code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions