2017-05-06 63 views

回答

2

不太髒的解決方案可能設置 ng-class="{'md-select-fixed-width': true}",當md-select-fixed-width: 140px;
這樣即選擇將類似於:

<md-select name="startYear4" 
       ng-model="ctrl.year4" 
       md-no-cache="ctrl.noCache" 
       ng-class="{'md-select-fixed-width':true}" 
       required> 
     <md-option ng-repeat="year4 in [2017, 2016, 2015]" value={{year4}} ng-bind="year4">{{year4}}</md-option> 
</md-select> 

和css:

.md-select-fixed-width { 
    width: 140px; 
} 

codepen