What are the common solutions for making clean id space in a SPA?

后端 未结 7 2166
感情败类
感情败类 2021-02-14 05:05

Situation: several developers working remotely on different section/modules of a SPA. As a result they may accidentally introduce HTML elements with the same id. W

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-14 05:33

    If your code(problem) really big, and you can't refactor it, you can try validate your css/html for find repeat id's before each commit. But it's possible answer for very bad situations.

    Good solution - using tools like bem (http://bem.info/)

提交回复
热议问题