我使用AngularJS
将dashboard.scss
导入到index.js
中,该{@ 1}}会导入所有必需的依赖项,例如:
index.js
import angular from 'angular';
import 'dashboard.scss';
import DashboardService from './services/dashboard.service.js';
import CalculateService from '../../services/calculate.service.js';
import CostAnalysisService from '../../services/cost-analysis.service.js';
import DashboardController from './controllers/dashboard.controller';
import AvailableActionsController from './controllers/actions-available.controller';
import GraphDonutController from './controllers/donut-chart.controller';
import routing from './dashboard.routes';
export default angular.module('ppApp.dashboard', [DashboardService, CalculateService, CostAnalysisService]) //import dashboard view controllers
.config(routing)
.controller('DashboardController', DashboardController)
.controller('AvailableActionsController', AvailableActionsController)
.controller('GraphDonutController', GraphDonutController)
.name;
所有文件都与index.js
位于同一目录中。当我加载应用程序时,除了dashboard.scss
中的CSS之外,其他所有东西都没有加载。但是,当我更改语法并在控制台中记录了导入变量时:
import {} from 'dashboard.scss';
console.log({})
有效...
问题
为什么不dashboard.scss
使用语法import 'dashboard.scss'
导入?