Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: stop stubs leaking with localVue (#1056)
- Loading branch information
1 parent
9abfda5
commit 5500553
Showing
11 changed files
with
44 additions
and
33 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import { addHook } from './add-hook' | ||
import { BEFORE_RENDER_LIFECYCLE_HOOK } from 'shared/consts' | ||
|
||
export function addStubs (_Vue, stubComponents) { | ||
function addStubComponentsMixin () { | ||
Object.assign(this.$options.components, stubComponents) | ||
} | ||
|
||
addHook(_Vue.options, 'beforeMount', addStubComponentsMixin) | ||
// beforeCreate is for components created in node, which | ||
// never mount | ||
addHook(_Vue.options, 'beforeCreate', addStubComponentsMixin) | ||
_Vue.mixin({ | ||
[BEFORE_RENDER_LIFECYCLE_HOOK]: addStubComponentsMixin | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters