Vue开发积累 发表于 2021-11-26 分类于 web 本文字数: 356 阅读时长 ≈ 1 分钟 Vue 开发积累001:scoped 关键字的作用在 xx.vue 组件中,我们可能会遇到带 scoped 关键字的样式。比如: 1234567891011121314151617<!-- Add "scoped" attribute to limit CSS to this component only --><style scoped>h3 { margin: 40px 0 0;}ul { list-style-type: none; padding: 0;}li { display: inline-block; margin: 0 10px;}a { color: #42b983;}</style> 上方的scoped表示的是作用域化,样式只对当前子组件生效。 相关文章推荐 02-Git的使用 03-网络抓包和代理工具:Whistle Atom在前端的使用 Emmet in VS Code Mac安装和配置iTerm2 赞赏一下吧~ 打赏 支付宝 本文作者: tongsiying 本文链接: https://tongsiying.github.io/2021/11/26/web/16-前端工程化/Vue开发积累/ 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!