我们如果打开查看网页源代码的时候,会发现如果你给当前页面如果添加了scoped则会给每个属性的后面添加一个属性选择器,然后属性选择器里面的数组是随机数,从而保证属性样式的代码唯一性
<template>
<div class="example" data-v-49729759>hello world</div>
</template>
<style scoped>
.example[data-v-49729759] {
color: red;
}
</style>
我们如果打开查看网页源代码的时候,会发现如果你给当前页面如果添加了scoped则会给每个属性的后面添加一个属性选择器,然后属性选择器里面的数组是随机数,从而保证属性样式的代码唯一性
<template>
<div class="example" data-v-49729759>hello world</div>
</template>
<style scoped>
.example[data-v-49729759] {
color: red;
}
</style>