Giter VIP home page Giter VIP logo

Comments (1)

NicoHof avatar NicoHof commented on June 4, 2024 1

Update from my side: I found two ways to get around this issue.

Nr 1. Do not use the v-model shorthand
use the long version of v-model with the correct prop and event name from the (vue3) child component

<Field
  :model-value="url"
  @update:model-value="(newValue) => (url = newValue)"
  // instead of v-model="url"
>

Nr 2. Set MODE: 3 for vee-validate to fix v-model shorthand

  • I kind of missunderstood how the compat mode works
  • The compat configs need to be set on the child components, not (only) the parents.
  • The global compatConfig MODE: 3 in compilerOptions in vue.config.js seems not to apply automatically to all components. Or am I missing here something, too? And this maybe only is true for third party packages?

So to set MODE: 3 for vee validate components this kind of works in this case:

import { Field, Form as ValidationForm } from 'vee-validate'
Field.compatConfig = { MODE: 3 };
ValidationForm.compatConfig = { MODE: 3 };

I think in this cases this works but I can imagine if the 3rd party library component has again child components itself the issue gets bigger since we cannot go down there and set the MODE: 3 recursively for all childs. Or can we?

Both solutions do not feel too good and a bit hacky.
Any other solution would be very welcome.

from vee-validate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.