新项目
ng new [appname] --style less
已有的项目
修改 *.css 文件及引用处后缀名为 less并在 angular.json 文件中设置以下内容
{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newprojectroot": "projects", "projects": { "ngtest": { "root": "", "sourceroot": "src", "projecttype": "application", "prefix": "app", "schematics": { "@schematics/angular:component": { "styleext": "less" } } ...... }
总结
以上所述是小编给大家介绍的在angular 6中使用 less 的实例代码,希望对大家有所帮助
如对本文有疑问, 点击进行留言回复!!
解决三元运算符 报错“SyntaxError: can''t assign to conditional expression”
解决angular 使用原生拖拽页面卡顿及表单控件输入延迟问题
使用 Angular RouteReuseStrategy 缓存(路由)组件的实例代码
分享Angular http interceptors 拦截器使用(推荐)
网友评论