Reputation: 2601
mounted () {
this.data(); // or only data();
}
message: "this.data is not a function"
What is the best way to call data() after page load?
Upvotes: 0
Views: 110
Reputation: 1156
Maybe i don't know this.data() function, but just use data like sample below:
<script>
export default {
data() {
return {
foo: 'bar',
}
},
mounted() {
console.log(this.foo) // will print "bar"
},
}
</script>
Upvotes: 1