MatToolbar:尝试组合不同的工具栏模式

问题描述 投票:0回答:2

出现以下错误:

MatToolbar:尝试组合不同的工具栏模式。要么显式指定多个

<mat-toolbar-row>
元素,要么仅将内容放置在单行的
<mat-toolbar>
中。

我的代码已经在 mat-toolbar 中应用了 mat-toolbar-row。然而,该错误仍然存在。

html文件的代码片段如下:

<div class="wallpaper">
<mat-toolbar color="primary">
        <mat-toolbar-row>
         <span>Welcome, User</span>
         <span class="example-fill-remaining-space"></span>
         <span class="align-center"></span>
         <span class="example-spacer"></span>
         <button mat-button>Create Incident </button>
         <a [routerLink]="['/closed']"><button mat-button style="color: white">Closed Incident</button></a>
        
         <span class="example-spacer"></span>
         <a [routerLink]="['/login']"><button mat-button>Logout</button></a>
         <img src="../../assets/hsbc_logo3.png" class="logo-hsbc"/>
        </mat-toolbar-row>
        <h1>INCIDENT MANAGEMENT SYSTEM</h1>
</mat-toolbar>

<h1>Welcome to Incident Management System</h1>   
<mat-card style="background: transparent">    
    <!-- Title of an Card -->    
    <mat-card-title>Incident Details</mat-card-title>    
    <mat-card-content>    
        <form>    
            <table >    
                <tr>    
                    <td>    
                        <mat-form-field class="demo-full-width">    
                            <mat-label >Description</mat-label>
                            <textarea [(ngModel)]="incident.description" name="description" cdkTextareaAutosize
                            cdkAutosizeMinRows="1"
                            cdkAutosizeMaxRows="5"  matInput></textarea>    
                        </mat-form-field>    
                    </td>
                    <td>    
                           <h4>{{message}}</h4>    
                    </td>     
                </tr>    
                    
                <tr>    
                    <td>    
                        <mat-form-field class="demo-full-width">    
                            <input matInput [matDatepicker]="picker" placeholder="Incident Date" [(ngModel)]="incident.date" name="date" >    
                            <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>    
                            <mat-datepicker touchUi="true" #picker></mat-datepicker>    
                        </mat-form-field>    
                    </td>    
                </tr>  
                <tr>    
                    <td colspan="2">    
                        <mat-form-field class="demo-full-width">    
                            <input matInput placeholder="Incident Category" [(ngModel)]="incident.category" name="category">    
                        </mat-form-field>    
                    </td>    
                </tr>  
                <tr>    
                    <td >    
                        <mat-form-field class="demo-full-width">    
                            <mat-select placeholder="Application Owner" [(ngModel)]="incident.owner" name="owner">    
                              <mat-option style="background-color:grey">-- Select--</mat-option>    
                              <mat-option style="background-color:cornsilk" value="1">BRV</mat-option>    
                              <mat-option style="background-color:cornsilk" value="2">FRTB</mat-option>    
                              <mat-option style="background-color:cornsilk" value="3">FSA</mat-option>    
                          </mat-select>
                        </mat-form-field>    
                    </td>    
                    <td>    
                        <mat-form-field>    
                            <mat-select placeholder="Symphony Group" [(ngModel)]="incident.symphony_group" name="symphony_group">    
                                <mat-option style="background-color:grey">-- Select --</mat-option>    
                                <mat-option style="background-color:cornsilk" value="1">MMO SheHacks</mat-option>    
                                <mat-option style="background-color: cornsilk" value="2">MMO IT INDIA</mat-option>    
                            
                            </mat-select>    
                        </mat-form-field>    
                    </td>
                </tr>  
                <tr>    
                    <td>     
                      <mat-form-field>    
                          <mat-select placeholder="Application" [(ngModel)]="incident.application" name="application">    
                              <mat-option style="background-color:grey">-- Select--</mat-option>    
                              <mat-option style="background-color:cornsilk" value="1">BRV</mat-option>    
                              <mat-option style="background-color:cornsilk" value="2">FRTB</mat-option>    
                              <mat-option style="background-color:cornsilk" value="3">FSA</mat-option>    
                          </mat-select>    
                      </mat-form-field>
                    </td>    
                    <td>    
                        <mat-form-field>    
                            <mat-select placeholder="Status" [(value)]="status"  [(ngModel)]="incident.status" name="status">    
                                <mat-option style="background-color:grey">-- Select --</mat-option>    
                                <mat-option style="background-color: green" value="1">Available</mat-option>    
                                <mat-option style="background-color: orange" value="2">Reduced</mat-option>    
                                <mat-option style="background-color: red" value="3">Unavailable</mat-option>    
                            </mat-select>    
                        </mat-form-field>    
                    </td> 
                       
                </tr>    
                  
                <tr>    
                    <td colspan="2">    
    
                    </td>    
                </tr>    
                <tr>    
                    <td colspan="2" class="content-center">    
                        <button style="margin:5px" mat-raised-button color="accent" (click)="submit()">Submit Incident</button>    
                        <button style="margin:5px" mat-raised-button color="accent" (click)="reset()">Clear</button> 
                        <button style="margin:5px" mat-raised-button color="accent">Raise BGCR</button>
                        <button style="margin:5px" mat-raised-button color="accent">Raise Jira</button>  
                    </td>    
                </tr>    
            </table>    
        </form>    
    </mat-card-content>    
</mat-card>   
</div>
javascript angular angular-material ecmascript-2016
2个回答
0
投票

您需要移除

<h1>INCIDENT MANAGEMENT SYSTEM</h1>
或将其放入
 <mat-toolbar-row>
内。


0
投票

我无法在垫子工具栏中填充图像 有什么帮助吗?

© www.soinside.com 2019 - 2024. All rights reserved.