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. nignx - docker內nginx 80端口被占用2. debian - docker依賴的aufs-tools源碼哪里可以找到啊?3. docker網絡端口映射,沒有方便點的操作方法么?4. 前端 - ng-view不能加載進模板5. android clickablespan獲取選中內容6. docker容器呢SSH為什么連不通呢?7. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””8. docker綁定了nginx端口 外部訪問不到9. angular.js - angular內容過長展開收起效果10. docker images顯示的鏡像過多,狗眼被亮瞎了,怎么辦?
