vue-router使用keep-alive和v-ref指令时出现this.$refs变null问题

Created on 10 Sep 2016  ·  5Comments  ·  Source: vuejs/vue-router

出现bug步骤

例如
<template> <div id="view"> <router-view v-ref:app :transition="transitionName" keep-alive></router-view> </div> </template>

打开页面1》跳转页面2》返回到页面1 然后log出this.$refs this.$refs.app变成null

这里上传不了文件,我把出现bug的demo放在百度云
链接: http://pan.baidu.com/s/1eRIWQl0 密码: i6jt

need repro

Most helpful comment

不是所有人都闲的没事下载-解压-npm install-npm run dev跑起来然后帮你debug。
不好意思说了这么多废话。总之请使用jsfiddle/codepen提供重现,谢谢。

All 5 comments

请用jsfiddle/codepen之类工具的给出最小化重现,不要把代码打包传上来。并且请说明vue和vue-router版本。

"vue": "^1.0.21",
"vue-loader": "^8.3.0",
"vue-router": "^0.7.13",

我上传的是代码demo来的,没有其他代码,运行在浏览器操作几下就能看到问题出现

`“

”`

不是所有人都闲的没事下载-解压-npm install-npm run dev跑起来然后帮你debug。
不好意思说了这么多废话。总之请使用jsfiddle/codepen提供重现,谢谢。

Closing due to inactivity.

Was this page helpful?
0 / 5 - 0 ratings