简体   繁体   English

无法更改VueJs插件的.Css文件

[英]Can't change .Css file for VueJs plugin

I am using vue-js-modal plugin, And inside this plugin, there is a style.css file. 我正在使用vue-js-modal插件,并且在此插件中,有一个style.css文件。 In this file, I need to change some setting to customize the changes in the modal style. 在此文件中,我需要更改一些设置以自定义模式样式中的更改。 But when I access this file and change whatever I want and then save my changes and run the application, the modal page look like the previous style and setting! 但是,当我访问此文件并更改所需内容,然后保存更改并运行应用程序时,模态页面看起来就像以前的样式和设置一样! And when I opened the console and checked the elements and select the modal page, the style setting in the browser it's the same previous setting! 当我打开控制台并检查元素并选择模式页面时,浏览器中的样式设置与之前的设置相同! How can I solve this problem? 我怎么解决这个问题? Do I need to build the file contains the style.css ? 我是否需要构建包含style.css的文件? If yes, how can I build it? 如果是,我该如何建造? If no, how to solve it? 如果没有,该如何解决?

如果使用单文件组件,为什么不覆盖自己想要更改的CSS规则,无论是在自己的CSS文件中还是在style标签中?

A quick fix would be to change the version of the css file by adding to the path of the file. 一个快速的解决方法是通过添加到文件的路径来更改css文件的版本。

Old: "/mycssfile.css" 旧的:“ / mycssfile.css”

New: "/mycssfile.css?1" 新增:“ / mycssfile.css?1”

Try using Deep Selector in you vue app to rewrite modal css https://vue-loader.vuejs.org/guide/scoped-css.html#deep-selectors 尝试在vue应用中使用Deep Selector重写模式CSS https://vue-loader.vuejs.org/guide/scoped-css.html#deep-selectors

for me syntax is following 对我来说语法如下

/deep/ p {
  margin-top: 0;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM