a.vue
<template>
<div>
<button class="btn btn-primary">11a.vue</button>
</div>
</template>
<style scoped>
@import '../css/bootstrap.css';
</style>
b.vue
<template>
<div>
<button class="btn btn-primary">b.vue</button>
</div>
</template>
<style scoped>
</style>
但是在访问b.vue的时候却附带了boostrap的样式,scoped没起隔离作用域的效果?
把
@import '../css/bootstrap.css';
去掉;换成
<style src="../css/bootstrap.css" scoped></style>
就好了