Replies: 5 comments
-
I made a POC in Stackblitz, showing that it technically works. https://stackblitz.com/edit/vue3-vmodel-with-slot?file=src%2FApp.vue |
Beta Was this translation helpful? Give feedback.
-
Would also like this implemented. |
Beta Was this translation helpful? Give feedback.
-
Any news on this one? |
Beta Was this translation helpful? Give feedback.
-
Any updates? |
Beta Was this translation helpful? Give feedback.
-
Mentioned a use case for this in #495 (comment) |
Beta Was this translation helpful? Give feedback.
-
What problem does this feature solve?
Currently, it seems that
v-model
is not supported with Vue<slot>
.This is the current ESLint rule, which does not allow
v-model
in<slot>
:https://eslint.vuejs.org/rules/valid-v-model.html
https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/valid-v-model.js#L32
But now with Vue 3, event handlers such as
@update:modelValue
are passed as props prefixed withon
, so technically they are available as slot props.What does the proposed API look like?
(This is currently technically possible, but not very elegant)
MyComponent.vue:
App.vue:
Beta Was this translation helpful? Give feedback.
All reactions