插件:
编写一个插件,里面可以写很多功能
install(Vue, a, b){
//全局过滤器
//全局指令
...
}
使用的时候需要引入:import导入 + 使用:Vue.use(plugins)
scoped
组件的样式名称冲突了,怎么解决?
<style scoped>
.demo {
background-color: red;
}
</style>
使用之后,作用域只作用在当前的这个组件中。