How to pass props to slot from wrapper at Vue.js?
up vote
0
down vote
favorite
In Vue.js I have component-wrapper to realize some logic and pass props to children:
<CarContainer>
<Ferarri color="red">
<CarContainer>
I want to add some props to Ferrari using render function in CarContainer:
render: function(createElement) {
const { author } = this;
return createElement(
'div',
{
props: {
author
},
},
[this.$slots.default],
);
},
But finally my Ferrari component has only color prop. How can I implement this task? Or maybe should I use mixins?
javascript vue.js
add a comment |
up vote
0
down vote
favorite
In Vue.js I have component-wrapper to realize some logic and pass props to children:
<CarContainer>
<Ferarri color="red">
<CarContainer>
I want to add some props to Ferrari using render function in CarContainer:
render: function(createElement) {
const { author } = this;
return createElement(
'div',
{
props: {
author
},
},
[this.$slots.default],
);
},
But finally my Ferrari component has only color prop. How can I implement this task? Or maybe should I use mixins?
javascript vue.js
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
In Vue.js I have component-wrapper to realize some logic and pass props to children:
<CarContainer>
<Ferarri color="red">
<CarContainer>
I want to add some props to Ferrari using render function in CarContainer:
render: function(createElement) {
const { author } = this;
return createElement(
'div',
{
props: {
author
},
},
[this.$slots.default],
);
},
But finally my Ferrari component has only color prop. How can I implement this task? Or maybe should I use mixins?
javascript vue.js
In Vue.js I have component-wrapper to realize some logic and pass props to children:
<CarContainer>
<Ferarri color="red">
<CarContainer>
I want to add some props to Ferrari using render function in CarContainer:
render: function(createElement) {
const { author } = this;
return createElement(
'div',
{
props: {
author
},
},
[this.$slots.default],
);
},
But finally my Ferrari component has only color prop. How can I implement this task? Or maybe should I use mixins?
javascript vue.js
javascript vue.js
edited Nov 19 at 13:51
asked Nov 19 at 13:25
Alexander Knyazev
2681313
2681313
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53375626%2fhow-to-pass-props-to-slot-from-wrapper-at-vue-js%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown