在Angular 8中,可以通过以下方式拒绝应用样式表:
打开angular.json
文件,可以在项目根目录下找到该文件。
在architect > build > options
下找到styles
属性,将其注释或删除掉。
"architect": {
"build": {
"options": {
...
// "styles": [
// "src/styles.css"
// ],
...
},
...
},
...
}
angular.json
文件。通过上述步骤,你就可以拒绝应用样式表了。
然后,你可以使用Bootstrap来添加样式。下面是一个使用Bootstrap的示例:
npm install bootstrap
src/styles.css
文件中添加以下内容,引入Bootstrap的样式:@import '~bootstrap/dist/css/bootstrap.css';
现在,你的应用将拒绝应用样式表,并使用Bootstrap的样式。