I have vue templates that is toggled each by a function for v-show and its corresponding getter and setter for v-model:
<p>To : <span v-show="!emailToSW">{{toEmailSet}}</span>
<input v-show="emailToSW" type="text" v-model.lazy="toEmailSet" />
<a href="#" @click.prevent="toggleEmailTo();">{{emailToSW ? '
I've implemented a snippet using both your code and a component to model the same things. The component should be called with
value
instead ofv-model
since the component callscomponentSignal
rather than emitting aninput
event.You can see that they both work the same and affect the same things (I made
componentSignal
set the value of the variable, but it can do whatever you want it to).