1. 程式人生 > >vue實現3級聯動

vue實現3級聯動

<el-col :span="4">
    <el-form-item label="代理商">
        <el-select v-model="formData.agentid" placeholder="" @change="changeAgent">
            <el-option label="全部" :value="0"></el-option>
            <el-option :label="item.agentname" :value="item.agentid" :key="item.agentid"
v-for="item in dlsList"></el-option> </el-select> </el-form-item> </el-col> <el-col :span="4"> <el-form-item label="工作室"> <el-select v-model="formData.studioid" placeholder=""> <el-option label="無"
:value="0"></el-option> <el-option :label="item.studioname" :value="item.studioid" :key="item.studioid" v-for="item in gzsList" v-if="formData.agentid == item.agentid"></el-option> </el-select> </el-form-item> </el-col>
<el-col :span="4"> <el-form-item label="銷售"> <el-select v-model="formData.sellerid" placeholder=""> <el-option label="無" :value="0"></el-option> <el-option :label="item.sellername" :value="item.sellerid" :key="item.sellerid" v-for="item in xsList" v-if="formData.studioid == item.studioid"></el-option> </el-select> </el-form-item> </el-col>

通過3級聯動關聯資訊控制option顯示