我正在使用primeng自动完成(https://www.primefaces.org/primeng/#/autocomplete),bootstrap 4和materializecss(http://materializecss.com/getting-started.html)。我发现唯一真正弄乱页面的css是自动填充表单框。
如何阻止materialize.css搞乱自动完成组件的样式?
<form>
<p-autoComplete [(ngModel)]="texts" [suggestions]="results" (completeMethod)="search($event)" [multiple]="true">
<ng-template let-value pTemplate="selectedItem">
<span style="font-size:18px">>{{value}}<</span>
</ng-template>
</p-autoComplete>
</form>
答案 0 :(得分:0)
只需将browser-default
类添加到p-autoComplete
元素,以便在这种情况下忽略Materialize CSS:
<p-autoComplete inputStyleClass="browser-default" [(ngModel)]="texts" [suggestions]="results" (completeMethod)="search($event)" [multiple]="true">
<ng-template let-value pTemplate="selectedItem">
<span style="font-size:18px">>{{value}}<</span>
</ng-template>
</p-autoComplete>
见工作Plunker