Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
97572d42
Commit
97572d42
authored
Aug 21, 2018
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create 'mountComponentWithRender' for testing with slots
parent
d2590b15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
spec/javascripts/helpers/vue_mount_component_helper.js
spec/javascripts/helpers/vue_mount_component_helper.js
+10
-0
No files found.
spec/javascripts/helpers/vue_mount_component_helper.js
View file @
97572d42
import
Vue
from
'
vue
'
;
const
mountComponent
=
(
Component
,
props
=
{},
el
=
null
)
=>
const
mountComponent
=
(
Component
,
props
=
{},
el
=
null
)
=>
new
Component
({
new
Component
({
propsData
:
props
,
propsData
:
props
,
...
@@ -25,4 +27,12 @@ export const mountComponentWithSlots = (Component, { props, slots }) => {
...
@@ -25,4 +27,12 @@ export const mountComponentWithSlots = (Component, { props, slots }) => {
return
component
.
$mount
();
return
component
.
$mount
();
};
};
/**
* Mount a component with the given render method.
*
* This helps with inserting slots that need to be compiled.
*/
export
const
mountComponentWithRender
=
(
render
,
el
=
null
)
=>
mountComponent
(
Vue
.
extend
({
render
}),
{},
el
);
export
default
mountComponent
;
export
default
mountComponent
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment