title: How to access the state of a local variable within a method - Vue?
body: <p>How to access the state of a local variable within a method - Vue?</p>
  
  <p>I need to set a value for the dialog so that I can open the popUp.</p>
  
  <p>By porting I want to open the popUp after loading the Then return data.</p>
  
  <pre><code>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    &lt;------ Here
        })
      }
    }
  }
  </code></pre>