如何在方法-Vue中訪問(wèn)局部變量的狀態(tài)?我需要為對(duì)話框設(shè)置一個(gè)值,以便可以打開(kāi)彈出窗口。通過(guò)移植,我想在加載“然后返回?cái)?shù)據(jù)”后打開(kāi)彈出窗口。import { mapState, mapGetters, mapActions } from 'vuex'export default { name: 'PageIndex', data () { return { dialog: false, } }, methods: { ...mapActions('example', ['retrievePratica']), aulaPratica (tipo, aula) { var data = { 'tipo': tipo, 'aula': aula } this.retrievePratica(data).then(function () { this.$store.state.dialog = true <------ Here }) } }}
如何在方法-Vue中訪問(wèn)局部變量的狀態(tài)?
眼眸繁星
2021-05-04 17:37:34