javascript - vuejs頁面加載完成后執行函數
問題描述
module.exports = {
data: function(){ return {memberQrcodeState: false }},components: {memberQrcode},created: function(){},beforeRouteEnter: function(to, from, next) { // 在渲染該組件的對應路由被 confirm 前調用 // 不!能!獲取組件實例 `this` // 因為當鉤子執行前,組件實例還沒被創建 //$e.target.src= require('../imgs/test/232.jpg') next(); return true;},methods: { },beforeRouteLeave: function(to, from, next) { // 導航離開該組件的對應路由時調用 // 可以訪問組件實例 `this` next();}
};
在這基礎上加一個頁面加載完成后執行的函數!我是小白,第二天接觸vuejs,希望大神指點一二
問題解答
回答1:mounted(){ this.init()},methods:{ init(){console.log(’hello,world’) }}
謹供參考~
回答2:Vue2.0
mounted(){ console.log('頁面加載完成')}回答3:
mounted
相關文章:
1. docker不顯示端口映射呢?2. docker內創建jenkins訪問另一個容器下的服務器問題3. vim - docker中新的ubuntu12.04鏡像,運行vi提示,找不到命名.4. docker-compose 為何找不到配置文件?5. docker images顯示的鏡像過多,狗眼被亮瞎了,怎么辦?6. debian - docker依賴的aufs-tools源碼哪里可以找到啊?7. docker gitlab 如何git clone?8. mac連接阿里云docker集群,已經卡了2天了,求問?9. docker-compose中volumes的問題10. docker api 開發的端口怎么獲取?
