-
Hi, i am having "VueCompilerError: v-model value must be a valid JavaScript member expression." when i am using the below code
how can i expose deliveries from useFieldArray('deliveries') so it can be available to the template and i can use it on v-model without using this syntax when i use Component it does work but problem is the style is off so i want to use which is styled nice and have more features. this does work fine. problem is css style is going to be different and i cannot afford that.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
You can try rendering the input element with
Or create a custom Or If you handle it manually, you will have to break up the // in setup
const { fields, update, insert } = useFieldArray('deliveries');
function handleInputChange(idx, value) {
if (!fields.value[idx]) {
insert(idx, { branch: value });
return;
}
update(idx, value);
} <el-input @update:modelValue="handleInputChange"> I might experiment with changes to allow mutating the field value directly with v-model but will probably land in |
Beta Was this translation helpful? Give feedback.
-
100%
|
Beta Was this translation helpful? Give feedback.
You can try rendering the input element with
Field
component:Or create a custom
useField
component that uses theel-input
element. The official vee-validate examples forelement plus
have a few ways you can integrate vee-validate with it.Or If you handle it manually, you will have to break up the
v-model
directive. I didn't try this out personally but it should work:<el-…