vue created和mounted区别

1: 当登录成功后台返回一个登陆时间,放在页面上, 用sessionStorage.setTime()设置下

在另一个页面sessionStorage.getTime()获取下, 放在created(){}中, 然后定义个变量接收下, 最后在标签中使用

2: 当已进入这个页面  就要看到页面渲染的数据, 可以用mounted(){}

你可能感兴趣的:(vue created和mounted区别)