美文网首页
Angular primeng使用记录

Angular primeng使用记录

作者: 执着于98斤的it女 | 来源:发表于2021-08-09 16:55 被阅读0次

    p-dropdown 改变value和label 并进行校验的实现

    <div class="form-group " style="display: flex;">
            <label class="label-width" for="repairPartSelect">*异常抄送角色:</label>
            <p-dropdown id="repairPartSelect" required name="repairPart" 
                             #repairPartSelect="ngModel"
                            [options]="unitsList" [(ngModel)]="ngForm.ccRole" dataKey="id" [filter]="true"         
                             filterBy="label"      [optionLabel]="'name'">
              </p-dropdown>
              <validation-messages [formCtrl]="repairPartSelect"></validation-messages>
    </div>  
    

    p-multiSelect 多选下拉 ---改变value和label 并进行校验的实现

    <div class="form-group " style="display: flex;">
             <label class="label-width" for="repairPartSelect">*异常抄送角色:</label>
    
            <p-multiSelect [options]="unitsList" id="repairPartSelect" filter="filter"   
                     optionLabel="name"
                            dataKey="id" name="repairPart" #repairPartSelect="ngModel" required 
                            [(ngModel)]="ccRole"   [virtualScroll]="true" [itemSize]="34"></p-multiSelect>
    
            <validation-messages [formCtrl]="repairPartSelect"></validation-messages>
    </div>
    

    相关文章

      网友评论

          本文标题:Angular primeng使用记录

          本文链接:https://www.haomeiwen.com/subject/kdgzvltx.html