Tutorial by Examples

In Vue.js, conditional rendering is achieved by using a set of directives on elements in the template. v-if Element displays normally when condition is true. When the condition is false, only partial compilation occurs and the element isn't rendered into the DOM until the condition becomes true. ...
Assuming we have a Vue.js instance defined as: var vm = new Vue({ el: '#example', data: { a: true, b: false } }); You can conditionally render any html element by including the v-if directive; the element that contains v-if will only render if the condition eval...
The use of the v-show directive is almost identical to that of v-if. The only differences are that v-show does not support the <template> syntax, and there is no "alternative" condition. var vm = new Vue({ el: '#example', data: { a: true } }); The basic u...

Page 1 of 1