Questions any time!
<div id="app">
<input v-model="greeting">
<p>{{ greeting }}</p>
</div>
<script src="https://unpkg.com/vue"></script>
<script>
new Vue({
el: '#app',
data: {
greeting: 'Hello world!'
}
})
<script>
<h1>Hi, {{ name }}</h1>
ng-if
ng-show
ng-repeat
ng-model
v-if
v-show
v-for
v-model
<!-- Is this for CSS? -->
<div class="my-angular-directive"></div>
<!-- This comment affects the rendered code?! -->
<!-- directive: my-angular-directive -->
Modules
Controllers
Directives
<input v-bind:placeholder="placeholderInstructions">
<p v-bind:class="{ 'has-error': error }">
...
</p>
<input
v-on:input="doSomething"
v-on:change="doSomething"
v-on:click="doSomething"
>
<input
v-on:auxclick="doSomething"
v-on:contextmenu="doSomething"
v-on:syntaxerror="doSomething"
>
Vue.directive('focus', {
// When the bound element is
// inserted into the DOM...
inserted: function (el) {
// Focus the element
el.focus()
}
})
<input v-focus>
export default {
// ... my component code ...
}
import MyComponent from './my-component.vue'