S
S
sharoncarms2021-03-28 16:08:40
Vue.js
sharoncarms, 2021-03-28 16:08:40

How to access data in vue cli?

Hello, in vue cdn to get a variable from data it was enough to use this.myVariable
but for some reason this does not work in vue cli

<script>
export default {
  name: "Auth",
  data() {
    return {
      page: 0,
    };
  },
  methods: {
    selectPage(number) {
      this.page = number; //пишет что this == undefined
    },
  },
  directives: {
  },
};
</script>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question