我有一個v-if以 HTML 格式顯示錯誤消息的 <div id="error" v-if="showError">Error User or Password</div> data() { return { showError: false,};}如果我設置數據,showError: true它就會出現。但是當我在我的捕獲中調用它時: catch (error) { alert('Usuário ou senha inválidos') }工作alert正常,但如果我發送showError = true或者showError: true;不出現 HTML 中的錯誤消息( v-if)我怎么做?
嘗試 catch v if
智慧大石
2023-09-07 16:02:38