简体   繁体   English

如何在Nativescript Vue中导入scss文件?

[英]How do I import scss file in Nativescript Vue?

In app.scss file, I import css as follows: app.scss文件中,我按如下所示导入css:

@import "../node_modules/bulma/sass/utilities/_all.sass";
@import "../node_modules/bulma/sass/elements/button.sass";

Tried even by removing ../node_modules/ , the css is still not working. 即使通过删除../node_modules/了尝试,css仍然无法正常工作。 The styles won't apply at all. 样式根本不适用。 Please help. 请帮忙。

Bulma will not work with NativeScript-Vue. Bulma不适用于NativeScript-Vue。

NativeScript has its own components and CSS properties. NativeScript具有自己的组件和CSS属性。 NativeScript is not HTML and not normal CSS (even if sometimes they are very similar). NativeScript不是HTML也不是普通的CSS(即使有时它们非常相似)。 Some things could work, but I would not follow this route, though. 有些事情可能会起作用,但是我不会遵循这条路线。 If nothing else, because it will load a bunch of unused CSS. 如果没有其他原因,因为它将加载一堆未使用的CSS。

Even so, the proper way to @import CSS/SCSS from node_modules , assuming you have the default webpack config, would be: 即便如此,假设您具有默认的webpack配置,从node_modules @import CSS / SCSS的正确方法是:

@import "~bulma/sass/utilities/all";
@import "~bulma/sass/elements/button";

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

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