【发布时间】:2021-09-19 05:44:51
【问题描述】:
在
https://codesandbox.io/s/compassionate-gagarin-qxp98?file=/src/components/GenericItem.vue:1921-1957
我正在尝试显示需要样式的模式。使用
<style scoped>
@import "../styles/modal-style.css";
</style>
不加载合适的样式,也不粘贴内容
https://codesandbox.io/s/compassionate-gagarin-qxp98?file=/src/styles/modal-style.css:0-1064
进入style标签。
我们的想法是得到类似的东西
https://codesandbox.io/s/sleepy-tdd-jrrgg?file=/index.html:122-181
但模态是单个文件组件。
为什么 vue 不加载样式?
【问题讨论】:
-
它的加载很好,只是例如你的目标
.modal-header h3但默认插槽没有h3,所以它不是绿色 -
尝试将模态添加添加到
h3样式确实发生了变化,但没有达到预期。
标签: javascript css vue.js vuejs2 vue-component