Welcome to Vue Js
* Pre requirements
1.
JavaScript
2.
HTML
3.
css
* What is vue?
- Vue js is a client side JavaScript
frame work which is mostly used to create front-end part of the web-site
- Using vue js we can create the
one page application using vue-router
* Installation
- We can install vue js using npm
via command npm install vue
- For the single page application
vue js provide the CLI, you can install it via command npm install –global vue-cli
* How to use with symfony
- To user it in Symfony we need
npm package encore to compile assets
composer require encore
- Install vue-loader and vue-template-loader
to compile vue js
- Next we need to create the
webpack.config.js to set the configuration of compilation
* What are
Components?
- Components are one of the most
powerful features of Vue.
- They help you extend basic HTML
elements to encapsulate reusable code. At a high level, components are custom
elements that Vue’s compiler attaches behaviour to.
- In some cases, they may also
appear as a native HTML element extended with the special attribute.
- To register a global component,
you can use Vue.component (tagName, options).
For example:
Vue.component('my-component',
{});
Comments
Post a Comment