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