1
我試圖使用框架7的API
此$ f7.showPreloader()
mounted() {
this.getPosts();
},
。methods: {
getPosts() {
this.$f7.showPreloader();
var self = this
axios.get('http://jsonplaceholder.typicode.com/posts')
.then(response => {
self.posts = response.data
self.$f7.hidePreloader();
})
.catch(e => {
this.errors.push(e)
})
},
當應用程序加載時,它在掛接掛鉤中給出一個錯誤:「TypeError:this。$ f7 is undefined」。然而,當我把它作爲一個@單擊事件,它的工作原理
clickme() {
this.getPosts();
},
如何正確調用API F7對象從安裝事件掛鉤?