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下的nginx压力测试2. docker安装后出现Cannot connect to the Docker daemon.3. docker start -a dockername 老是卡住,什么情况?4. docker内创建jenkins访问另一个容器下的服务器问题5. docker镜像push报错6. debian - docker依赖的aufs-tools源码哪里可以找到啊?7. html5 - node静态资源服务器设置了Cache-Control,但浏览器从来不走3048. 为什么我ping不通我的docker容器呢???9. nignx - docker内nginx 80端口被占用10. dockerfile - 为什么docker容器启动不了?

网公网安备