Skip to content

v-model compiling fails when used with functional components #1539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
miljan-aleksic opened this issue Apr 18, 2019 · 2 comments
Closed

v-model compiling fails when used with functional components #1539

miljan-aleksic opened this issue Apr 18, 2019 · 2 comments

Comments

@miljan-aleksic
Copy link

Version

15.7.0

Reproduction link

https://codesandbox.io/s/r58jr04jlo

Steps to reproduce

Click on the checkbox.

What is expected?

The checkbox should be selected without throwing js errors.

What is actually happening?

It's issuing an error becasue the compiled js code assumes it's a stateful component and tries to use _vm.$set().

@posva
Copy link
Member

posva commented Apr 18, 2019

Marking as both as I don't know if this was intended to work in the first place

@yyx990803
Copy link
Member

While I think this should technically work, I strongly suggest staying away from such usage.

  1. Functional component being able to mutate parent state is very implicit and not a good pattern.

  2. <template functional> is likely going away in v3. (See Functional and async components API change rfcs#27)

I'll close this as a wontfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants