父组件 (Parent component)
<template>
<children></children>
</template>
<script>
import children from './children'
export default {
components: {
children
}
}
</script>
<style lang="less">
.desc {
color: red;
}
</style>
子组件 (Child component)
<template>
<p class="desc">文案</p>
</template>
<style lang="less">
.desc {
color: yellow;
}
</style>
The display color is the color set for the parent component. There is a problem with the loading order of the parent component and the child component styles. Is it the packaging problem?