Skip to content

Commit 169a5a6

Browse files
PeachScriptposva
authored andcommitted
Fix instance reuse bug in out-in transition #1874 (#2127)
**What kind of change does this PR introduce?** (check at least one) - [x] Bugfix - [ ] Feature - [ ] Code style update - [ ] Refactor - [ ] Build-related changes - [ ] Other, please describe: **Does this PR introduce a breaking change?** (check one) - [ ] Yes - [x] No If yes, please describe the impact and migration path for existing applications: **The PR fulfills these requirements:** - [x] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch - [x] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number) - [x] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup - [ ] New/updated tests are included If adding a **new feature**, the PR's description includes: - [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it) **Other information:** This is a PR for #1874 , cc: @LinusBorg
1 parent 811846f commit 169a5a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/history/base.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,10 @@ function poll (
318318
key: string,
319319
isValid: () => boolean
320320
) {
321-
if (instances[key]) {
321+
if (
322+
instances[key] &&
323+
!instances[key]._isBeingDestroyed // do not reuse being destroyed instance
324+
) {
322325
cb(instances[key])
323326
} else if (isValid()) {
324327
setTimeout(() => {

0 commit comments

Comments
 (0)