我是Angular Material的新手,我看到它具有它自己的 复杂API。我来自Bootstrap,并且一直使用它作为网格系统常规类,例如行,容器, cols等。我想知道将它们混合在一起是好还是不好的做法:
<div class="container">
<div class="row">
<div class="col-md-6 offset-md-3">
<form class="my-form">
<mat-form-field class="full-width">
<mat-label>First Name</mat-label>
<input matInput placeholder="First name" name="fname" required>
</mat-form-field>
<mat-form-field class="full-width">
<mat-label>Last Name</mat-label>
<input matInput placeholder="Last Name" name="lname" required>
</mat-form-field>
<mat-form-field class="full-width">
<mat-label>Address</mat-label>
<input matInput placeholder="Address" name="address" required>
</mat-form-field>
</form>
</div>
</div>
</div>
如果没有,为什么?
答案 0 :(得分:1)
如果使用2个库,则可能会影响您的组件样式,而且效果不是很好。
可以减少效果的一件事是在angular.json中对导入进行排序,并将最重要的样式文件放在样式列表的最后
"styles": [
"bootstrap.css"
"material.css"
"src/styles.css" // yours css should be the last
]