Giter Site home page Giter Site logo

Comments (7)

LinusBorg avatar LinusBorg commented on June 2, 2024 4

I'd argue that this is expected behaviour. It's just not made explicit enough in the docs.

from docs.

edison1105 avatar edison1105 commented on June 2, 2024 2

This is because reactive data reassignment loses the reactive.

image

from docs.

unbrain avatar unbrain commented on June 2, 2024

const selected = defineModel({default: []});

Starting in Vue 3.4, the recommended approach to achieve this is using the defineModel() macro:

from docs.

LinusBorg avatar LinusBorg commented on June 2, 2024

const selected = defineModel({default: []});

Starting in Vue 3.4, the recommended approach to achieve this is using the defineModel() macro:

That has nothing to do with this issue.

from docs.

unbrain avatar unbrain commented on June 2, 2024

const selected = defineModel({default: []});

Starting in Vue 3.4, the recommended approach to achieve this is using the defineModel() macro:

That has nothing to do with this issue.

select same as checkbox
image

from docs.

Doctor-wu avatar Doctor-wu commented on June 2, 2024

On my side, the template was compiled to this, and $setup was processed by shallowUnwrapHandlers, it won't be collected when it's property was access, and it seems this behavior starts in very early version, don't know if it's a bug.
CleanShot 2024-04-03 at 16 42 34@2x
CleanShot 2024-04-03 at 16 43 52@2x
CleanShot 2024-04-03 at 16 44 06@2x
CleanShot 2024-04-03 at 16 44 10@2x

from docs.

bencodezen avatar bencodezen commented on June 2, 2024

Just to add clarification on the issue, docs should be updated to explain how v-model emits a new array (as opposed to updating an existing one) when working with <select multiple> and <input type="checkbox" multiple />.

from docs.

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.