Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9b5e557

Browse filesBrowse files
committed
Create options.beforeCreate in order to push it in handlers and call it along with the other beforeCreate actions
1 parent caa8868 commit 9b5e557
Copy full SHA for 9b5e557

File tree

Expand file treeCollapse file tree

1 file changed

+1
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-8
lines changed

‎src/lib/addProvide.js

Copy file name to clipboardExpand all lines: src/lib/addProvide.js
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,10 @@ function addProvide (component, options) {
55

66
delete options.provide
77

8-
const originalBeforeCreate = component.beforeCreate
9-
component.beforeCreate = function beforeCreate () {
8+
options.beforeCreate = function vueTestUtilBeforeCreate () {
109
this._provided = typeof provide === 'function'
1110
? provide.call(this)
1211
: provide
13-
14-
if (originalBeforeCreate) {
15-
originalBeforeCreate.call(this)
16-
}
17-
18-
component.beforeCreate = originalBeforeCreate
1912
}
2013
}
2114

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.