I'm writing a plug-in based on Vue 3, and now I need a feature that is obviously not part of the Vue 3 API, and I think that requires some knowledge of the Vue 3 source code to do that, here is a description of the required functionality:
Suppose you have the following code snippet:
<div class="box">
<input type="text" v-model="state.text">
</div>
<script>
const {createApp, reactive} = Vue
const vm = createApp({
setup ()
{
const state = reactive({
text: "123"
})
return {
state
}
}
}).mount(".box")
</script>
Based on this code snippet, I need to modify the v-model value outside of Vue through the dom object of the input element. How can I do this?
const input_dom = document.querySelector("input")
// I have obtained the input_dom, and I hope to change the value of state.text through input_dom.
input_dom??