Nativescript-vue:如何将 app.scss 移动到子文件夹中?
Nativescript-vue: how to move app.scss into a subfolder?
在新初始化的项目中(使用 tns create --vue
),app.scss
文件位于根 (/app
) 文件夹下。
我想移动到 /app/styles,但我找不到要更改的内容以告诉 nativescript 使用此位置而不是默认位置。
如何将 /app/app.scss
的默认位置更改为 /app/styles/app.scss
?
在此页面 ( https://docs.nativescript.org/angular/ui/styling#application-wide-css ) 我找到了这些提示,但是 与 angular 相关!
Application-wide CSS
When the application starts, NativeScript checks if the file app.css exists. If it does, any CSS styles that it contains are loaded and used across all application pages. This file is a convenient place to store styles that will be used on multiple pages.
You can change the name of the file from which the application-wide CSS is loaded. You need to do the change before the application is started, usually in the app.js or app.ts file as shown below:
platformNativeScriptDynamic({ bootInExistingPage:false, cssFile:"style.css" });
The path to the CSS file is relative to the application root folder.
但是我不知道这行代码在哪里。我找不到它。
我修复了在 app.js
文件顶部添加以下行的问题
import './styles/app.scss';
在新初始化的项目中(使用 tns create --vue
),app.scss
文件位于根 (/app
) 文件夹下。
我想移动到 /app/styles,但我找不到要更改的内容以告诉 nativescript 使用此位置而不是默认位置。
如何将 /app/app.scss
的默认位置更改为 /app/styles/app.scss
?
在此页面 ( https://docs.nativescript.org/angular/ui/styling#application-wide-css ) 我找到了这些提示,但是 与 angular 相关!
Application-wide CSS When the application starts, NativeScript checks if the file app.css exists. If it does, any CSS styles that it contains are loaded and used across all application pages. This file is a convenient place to store styles that will be used on multiple pages.
You can change the name of the file from which the application-wide CSS is loaded. You need to do the change before the application is started, usually in the app.js or app.ts file as shown below:
platformNativeScriptDynamic({ bootInExistingPage:false, cssFile:"style.css" });
The path to the CSS file is relative to the application root folder.
但是我不知道这行代码在哪里。我找不到它。
我修复了在 app.js
文件顶部添加以下行的问题
import './styles/app.scss';