寫了兩個(gè)按鈕,用muse-ui.結(jié)果第一次關(guān)注時(shí)無法切換(但請求發(fā)出去了,此時(shí)點(diǎn)擊其它的“取消關(guān)注”才會切換。)刷新后,已是“取消關(guān)注”的功能正常。//這是按鈕://對應(yīng)方法及請求methods:{//關(guān)注myFollow(item){var_this=this;axios.post('關(guān)注的請求‘).then(function(res){item.user_followed=true})},//取消關(guān)注unFollow(item){var_this=this;axios.post('取消關(guān)注的請求').then(function(res){item.user_followed=false})}}
vue寫一個(gè)關(guān)注功能,為何第一次關(guān)注時(shí)切換按鈕不起效?(但請求發(fā)出去了,此時(shí)點(diǎn)擊其它的“取消關(guān)注”才會切換。)
函數(shù)式編程
2019-05-25 13:40:45