在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML5  HTML/ 關(guān)于elementUI開關(guān)的問題

關(guān)于elementUI開關(guān)的問題

列表用了elementUI里的switch組件

clipboard.png

status是后臺(tái)返回的字段,是沒問題的。

開狀態(tài)為1,關(guān)狀態(tài)為0 但是開關(guān)這里對(duì)應(yīng)不出來這里顯示不出來。

代碼如下:

<el-table-column prop="status" label="status"></el-table-column> //沒問題,數(shù)據(jù)和后臺(tái)一樣
<el-table-column label="STATUS"> //有問題,數(shù)據(jù)對(duì)應(yīng)不起來
    <template slot-scope="scope">
        <el-switch 
            v-model="scope.row.status"
            active-value=1
            inactive-value=0
            @change=change_switch(scope.row.id,scope.row.status)>
        </el-switch>
    </template>
</el-table-column>     

回調(diào)如下:

change_switch:function(id,status){  
    console.log(status); 
    axios.get('/advertiser/updateStatus',{
        headers: {
            Authorization : getCookie('token'),
        },
        params:{
            id:id,
            status:status
        }
    })
    .then(res=>{
        console.log(res)
    })
},

回答
編輯回答
影魅
開狀態(tài)為1,關(guān)狀態(tài)為0 但是開關(guān)這里對(duì)應(yīng)不出來這里顯示不出來。
active-value=0
inactive-value=1

你確定么。。。寫反了吧。

2018年3月23日 12:21