【皇牌天下投注网】angular 设置年份选择下拉框,

来源:http://www.prospettivedarte.com 作者:计算机教程 人气:60 发布时间:2019-05-10
摘要:select ng-model="selectedYear" ng-change="yearChange(selectedYear)" option ng-repeat="x in yearList" value="{{x.k}}"{{x.v}/option /select 皇牌天下投注网, $scope.yearList = [ {k : "2014", v : "2014"}, {k : "2015", v : "2015"}, {k :
<select ng-model="selectedYear" ng-change="yearChange(selectedYear)">
                <option ng-repeat="x in yearList" value="{{x.k}}">{{x.v}</option>  
</select>

皇牌天下投注网,  

$scope.yearList = [
                {k : "2014", v : "2014"},
                {k : "2015", v : "2015"},
                {k : "2016", v : "2016"},
                {k : "2017", v : "2017"},
                {k : "2018", v : "2018"},
                {k : "2019", v : "2019"},
                {k : "2020", v : "2020"},
                {k : "2021", v : "2021"},
                {k : "2022", v : "2022"},
                {k : "2023", v : "2023"}
            ];

// 默认为今年
            var date = new Date;
            $scope.selectedYear = date.getFullYear();
            $scope.year = $scope.selectedYear;
            $scope.yearChange = function(v){
                $scope.year = v;
            };

 

本文由皇牌天下投注网发布于计算机教程,转载请注明出处:【皇牌天下投注网】angular 设置年份选择下拉框,

关键词:

上一篇:jest 自动化测试

下一篇:没有了

频道精选

最火资讯