boilerplate vue component
An example of a VueJS component code structure.
copy
An example of a VueJS component code structure.
copy
Create new Vue project in the current directory using Vue CLI command. To quickly create a project using default settings add "--default" flag at the end of the command.
copy
Directive "v-for" loops through an array and lets you output a new HTML element for each loop iteration.
copy
Install Vue CLI as a global package.
copy
Mounted method lets you execute code once Vue is fully loaded and ready.
copy
Create a new Vue instance.
copy
Serve Vue project using Vue CLI.
copy
Example of toggling CSS class using v-bind, v-on:click and inline conditional statement.
copy
Use "v-bind:" or a ":" shorthand for a two-way data binding with the selected attribute.
copy
v-model binding is a directive designed to work with forms and input fields.
copy
Vue on click directive listens for a click event on a given element. You can reference a method to fire on each click. Use v-on:click or a shorthand @click, they work exactly the same way.
copy
Show this element as long as the value is true.
copy