Vue.js中使用select初始化及编辑回显
在Vue.js中使用select选择下拉框有两种方法: 第一种: Add.html: < select v-model= " sysNotice.noticeType " id= " noticeType " class = " form-control " > <option disabled value= "" selected>请选择</option> <option v- for = " item in itemList " v-bind:value= " item.macroId " > {{ item.name }} </option> </ select > Add.js: var vm = new Vue({ el: ' #dpLTE ' , data: { itemList:[], // define select control list sysNotice: { noticeId: 0 , status: 0 , noticeType: '' // 默认未空,则选择框会自动默认为请选择 } }, methods : { getNoticeTypeList: function() { $.getJSON( ' ../../sys/macro/value?value=noticetype ' , null , function(data){ vm.itemList