Replies: 7 comments
-
Currently most scripts use |
Beta Was this translation helpful? Give feedback.
-
I agree, I don't think we need to add another variation to this API. |
Beta Was this translation helpful? Give feedback.
-
@posva I think this is not a issue... |
Beta Was this translation helpful? Give feedback.
-
@cyfung1031 using spread operator or Object.assing would result in overriding props instread of merging them. What if featAProps have onClick/class and featBProps as well? that's why you have to use mergeProps |
Beta Was this translation helpful? Give feedback.
-
This is another issue. You are not asking for binding multiple objects. You are asking for binding multiple methods to the same attribute in the same component. You should open another issue for this. They are different. The working principle for |
Beta Was this translation helpful? Give feedback.
-
This seems to be supported (accidentally?) only if you have other attributes bound too. // Works
<MyComponent foo="bar" v-bind="$attrs, featAProps, featBProps" />
// Doesn't
<MyComponent v-bind="$attrs, featAProps, featBProps" /> This is because attributes + v-bind is compiled directly to a _createBlock(_component_MyComponent, _mergeProps({ foo: "bar" }, _ctx.$attrs, _ctx.featAProps, _ctx.featBProps), null, 16 /* FULL_PROPS */) But _createBlock(_component_MyComponent, _normalizeProps(_guardReactiveProps(_ctx.$attrs, _ctx.featAProps, _ctx.featBProps)), null, 16 /* FULL_PROPS */) Related: vuejs/eslint-plugin-vue#1731 |
Beta Was this translation helpful? Give feedback.
-
Is this still considered a bug or is it a feature? It seems to still work in Vue 3 without any errors and I only have a separate |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What problem does this feature solve?
Currently, if we want to pass attributes from multiple sources we have to manually import
mergeProps
helper and door use computed property
It would be better if we could just do:
What does the proposed API look like?
Allow passing an array of props to v-bind
v-bind="[x,y,..]"
Beta Was this translation helpful? Give feedback.
All reactions