-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
fix(runtime-dom): true-value and false-value not working on first render #2696
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test too?
@@ -126,6 +126,13 @@ export const vModelCheckbox: ModelDirective<HTMLInputElement> = { | |||
} | |||
}) | |||
}, | |||
mounted(el, { value }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is likely to happen somewhere else, otherwise, it wouldn't work for SSR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test too?
of course.I will do it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runtime directives are never used during SSR anyway
Sorry, I just saw this after I pushed 48f00c0 (note it just moves the |
It does occur to me that |
@yyx990803 <div id="app">
<label>model {{ model }}</label>
<input type="checkbox" v-model="model" :true-value="11" :false-value="22" />
</div>
<script>
const { ref,createApp } = Vue
createApp({
name: "App",
setup() {
const model = ref(false);
return {
model,
};
},
}).mount('#app')
</script> After first render,the model value is still And my PR is make it works fine. |
close #2694