组件中的style中添加scoped,可以使其显示效果仅限于组件中应用:
<style scoped>
section h2 {
margin: 0.5rem 0;
color: #3a3a3a;
}
ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: row;
}
li {
margin-right: 1rem;
}
</style>
组件中的style中添加scoped,可以使其显示效果仅限于组件中应用:
<style scoped>
section h2 {
margin: 0.5rem 0;
color: #3a3a3a;
}
ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: row;
}
li {
margin-right: 1rem;
}
</style>