-
-
Save cursosdesarrolloweb/53d953dc7f6d8cfdae04d88fbdcdd29f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vue.component('vmodel-arrays', { | |
data () { | |
return { | |
frameworks: [] | |
} | |
}, | |
template: ` | |
<div> | |
<h2>vmodel con arrays en Vue 2</h2> | |
<input type="checkbox" id="vue" value="Vue" v-model="frameworks" /> | |
<label for="vuejs2">Vue</label> | |
<input type="checkbox" id="laravel" value="Laravel" v-model="frameworks" /> | |
<label for="reactjs">Laravel</label> | |
<input type="checkbox" id="django" value="Django" v-model="frameworks" /> | |
<label for="django">Django</label> | |
<p>Frameworks seleccionados: {{ frameworks }}</p> | |
</div> | |
` | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.component("vmodel-arrays", { | |
setup() { | |
const frameworks = ref([]); | |
return { frameworks }; | |
}, | |
template: ` | |
<h2>v-model con arrays en Vue 3</h2> | |
<input type="checkbox" id="vue" value="Vue" v-model="frameworks" /> | |
<label for="vuejs2">Vue</label> | |
<input type="checkbox" id="laravel" value="Laravel" v-model="frameworks" /> | |
<label for="reactjs">Laravel</label> | |
<input type="checkbox" id="django" value="Django" v-model="frameworks" /> | |
<label for="django">Django</label> | |
<p>Frameworks seleccionados: {{ frameworks }}</p> | |
` | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment