JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui/lib/index.js"></script>
<div id="app">
<template>
<div>
<div v-for="row in list">
<el-select v-model="row.geoAction" placeholder="请选择">
<el-option v-for="item in geoTypeOptions" :label="item" :value="item">
</el-option>
</el-select>
<el-select v-model="row.geoQuery.q" filterable remote placeholder="请输入关键词" :remote-method="remoteGenname(row)">
<el-option v-for="item in geoNameOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
</div>
SCSS
@import url("//unpkg.com/element-ui/lib/theme-default/index.css");
Babel + JSX
var Main = {
data() {
return {
list: [
{
geoAction: 'city',
geoQuery: ''
},
{
geoAction: 'province',
geoQuery: ''
}
],
geoTypeOptions: ['city', 'province', 'country'],
geoNameOptions: [],
}
},
methods: {
remoteGenname(row){
return val => {
console.log(row.geoAction,val)
}
},
}
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')