使用css module,就是在style标签里面加上scoped。 每个组件独有一个class,然后组件的所有样式都挂在这个class下面,如 .box{ xxx:xxx } .box .header{ } .box .footer{ } ...