The v-for directive is used for rendering lists. It is able to take multiple arguments, and can be used in child or parent components.
- Template Syntax
<div v-for="item in :key="item.id">
<!-- content -->items"
v-model is for two way data binding on form, input, textarea, and select.v-model ignores initial attributes on form elements. Instead, it looks for initial attributes in data().
this is a javascript keyword that is used to reference the object that the function it is in belongs to. It can be used in global and function contexts.
| <template> | |
| <input type="text" | |
| v-bind:inputValue="value" v-on:input="$emit('input', $event.target.value)" | |
| </template> | |
| <script> | |
| export default { | |
| props: 'inputValue' | |
| } | |
| </script> |
Tailwind gives you a few ways to organize your components. Check out this file
tailwind.config.css fileassets/ directory at the root of your project to store the css files.nuxt.config.js css declaration
| <template> | |
| <form v-on:submit.prevent="onSubmit"> | |
| <fieldset> | |
| <legend><h2>Add a new Task</h2></legend> | |
| <!-- title input --> | |
| <label for="title">Title</label> | |
| <input type="text" name="title" v-model="dataGroup.title" /> | |
| <!-- description input --> | |
| <label for="description">Description</label> | |
| <input type="text" name="description" v-model="dataGroup.description" /> |