Skip to content
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

Do you have an v-model example? #6

Open
yooouuri opened this issue Apr 24, 2020 · 3 comments
Open

Do you have an v-model example? #6

yooouuri opened this issue Apr 24, 2020 · 3 comments

Comments

@yooouuri
Copy link

I am trying the new Composition API but I am not getting v-model on a custom component working...

<custom-component v-model="something"></custom-component>

Inside the custom component, I have a prop called value and a watcher on the prop. But the watcher doesn't trigger..

export default {
        props: {
            value: Boolean,
        },
watch(props.value, (value, value2) => {
                console.info(value);
                console.info(value2);
            });
@sonicoder86
Copy link
Owner

Hi,

Does it mean it passes down a prop from parent to a child with the name value and this value should change when the parent component modifies the something variable?
I haven't tried it myself yet. If it's not working I would raise a ticket in the vue-next repository. They are really helpful.

@yooouuri
Copy link
Author

I meant just like: https://alligator.io/vuejs/add-v-model-support/

But then use the new Composition API

@sonicoder86
Copy link
Owner

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

No branches or pull requests

2 participants