Professional Documents
Culture Documents
SE1 Section 7
SE1 Section 7
○ is focused on the view layer only, and is easy to pick up and integrate with
other libraries or existing projects
VueJS – Key Features
● VueJS has the following features:
○ Fast
○ Reactive
○ Component based
Installing with VueJS
● You can install the VueJS framework in different ways:
1. Using the <script> tag in you HTML file
■ https://vuejs.org/v2/guide/installation.html
Installing NodeJS
2. Vie UI
Installing VueJS – VUE-CLI
● Two ways to create a vuejs project with vue-cli:
○ attach special meaning and behavior to plain HTML elements on the page
○ Example
Vue.JS – directives
● Conditionals directives:
○ v-if directive: can be used to test some conditions over the JavaScript
object data
○ v-else directive can be used when the conditions on the v-if fails
○ v-else-if directive can be used much like you would use else-if clauses in
JavaScript
○ Example
Vue.JS – directives
● v-show directive:
○ v-show: used to conditionally display an element (CSS based)
○ Example
Vue.JS – directives
● v-text directive:
○ Examples
Vue.JS – directives
Can be shorted to @click
v-on
●instead of directive:
v-on:click
○ listen to DOM events (click, keyup, submit, etc..) and run some
JavaScript when they’re triggered
○ Example
Vue.JS – directives
● loop (v-for) directives:
○ Example
Vue.JS – directives
● Other directives:
○ v-html
○ v-once
○ …
Vue.JS – methods
● To create a method in vue.js:
● Filters:
○ Are used to update any thing in the DOM and not the actual value
of the HTML elements
○ Example
Thanks