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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
a94b7f2f
Commit
a94b7f2f
authored
Jan 27, 2021
by
Mark Florian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explanation for attrs rather than props
parent
3fac0ad8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
app/assets/javascripts/monitoring/monitoring_app.js
app/assets/javascripts/monitoring/monitoring_app.js
+11
-0
No files found.
app/assets/javascripts/monitoring/monitoring_app.js
View file @
a94b7f2f
...
...
@@ -28,6 +28,17 @@ export default (props = {}) => {
},
render
(
h
)
{
return
h
(
'
RouterView
'
,
{
// This is attrs rather than props because:
// 1. RouterView only actually defines one prop: `name`.
// 2. The RouterView [throws away other props][1] given to it, in
// favour of those configured in the route config/params.
// 3. The Vue template compiler itself in general compiles anything
// like <some-component :foo="bar" /> into roughly
// h('some-component', { attrs: { foo: bar } }). Then later, Vue
// [extract props from attrs and merges them with props][2],
// matching them up according to the component's definition.
// [1]: https://github.com/vuejs/vue-router/blob/v3.4.9/src/components/view.js#L124
// [2]: https://github.com/vuejs/vue/blob/v2.6.12/src/core/vdom/helpers/extract-props.js#L12-L50
attrs
:
{
dashboardProps
:
this
.
dashboardProps
,
},
...
...
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