小编kha*_*eja的帖子

使垫选项和垫选择具有不同的 UI

我有一个下拉菜单,其中有电话号码的国家/地区代码。目前我希望所选项目仅具有标志图像或代码。下拉列表包含图像、国家/地区代码和国家/地区名称。

<mat-form-field appearance="outline" fullWidth>
  <mat-label>Country Code</mat-label>
  <mat-select #matSelect [(value)]="selectedCode" [formControlName]="helperService.appConstants.countryCode" (selectionChange)="changeSelection(selectedCode)" required>
    <mat-option *ngFor="let code of countryCode" [value]="code.calling_code" (keypress)="numberOnly($event)&&phoneNumberValid(registerObj.userForm)">
      <img with="10px" height="10px" src="{{code.flag}}"> {{ code.country }} ({{code.calling_code}})
    </mat-option>
  </mat-select>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)

这就是我正在编写的代码。我也有当前用户界面的图像。它们附在下面。

在此输入图像描述在此输入图像描述

我希望所选项目如下图所示。我不知道应该更改什么以使所选项目仅显示图像。

在此输入图像描述

angular-material angular

5
推荐指数
1
解决办法
1763
查看次数

标签 统计

angular ×1

angular-material ×1