vue使用select间相互绑定
让这两个select相互绑定,让roleOptions选取值后,worklist弹出得是roleOptions值 <el-select v-model="postForm.projectName" placeholder="请选择" @change="getList(postForm)"> <el-option v-for="item in roleOptions" :key="item.key" :label="item.label" :value="item.key"> </el-option> <el-select v-model="postForm" placeholder="请选择" value-key="id" @change="getList2(postForm)"> <el-option v-for="item in worklist" :label="item.productName" :value="item"> </el-option> 首先在created里面获取值,设res为null,传入getlist中; async created() { this.lastWorklist = await api_price_list({},this.queryParam); let res = null; this.getList(res) },