When learning javascript, we can often see vue.js, so what is vue.js? What can be done? Many friends may not fully understand it. In this article, php Chinese website will introduce to you what vue.js is and what it is used for. Friends who are interested can take a look.
First of all, let’s take a look at what vue.js is?
We can know from Baidu Encyclopedia that Vue.js is a progressive framework for building data-driven web interfaces. The goal of Vue.js is to enable responsive data binding and composed view components with the simplest possible API.
Vue’s core library only focuses on the view layer, and is very easy to learn and integrate with other libraries or existing projects. Vue, on the other hand, is fully capable of driving complex single-page applications developed using single-file components and libraries supported by the Vue ecosystem.
After reading the above introduction, do you feel that the explanation is a bit abstract? In fact, I have seen a simpler explanation: Vue.js is used to build a web version of Zhihu with many form items. Is it easier to understand a web-based application whose content needs to be modified based on user operations?
After reading what vue.js is, let’s take a look at what vue.js is mainly used for
What vue.js has use?
1. Vue.js can make the development of web-based front-end applications more convenient, because Vue.js has declarative, responsive data binding, and component-based development , and also uses Virtual DOM, a technology that sounds fancy just by looking at its name. So what are responsive data binding, component-based development and Virtual DOM? Let’s take a look at it in detail below.
Responsive data binding: Responsive here is not the responsive layout in @media media query, but means that vue.js will automatically respond to changes in certain data on the page.
Component-based development: Vue.js uses components to split various modules in a single-page application into separate components. We only need to write them in the parent application first. Various component tags (occupying pitfalls), and write the parameters to be passed into the component in the component tag (just like passing parameters into a function, this parameter is called the attribute of the component), and then write the implementation of various components separately. (Fill in the holes), and then the entire application is completed.
Virtual DOM: Virtual DOM is the English word for virtual DOM. Simply put, it is a method that can perform various calculations through JavaScript in advance to calculate and optimize the final DOM operation. Since this DOM operation belongs to The preprocessing operation does not actually operate the DOM, so it is called virtual DOM. Finally, the DOM operation is actually submitted after the calculation is completed, and the DOM operation changes are reflected to the DOM tree.
2. Vue can simply write a single page or a large front-end system.
3. Vue can make front-end single-page applications from simple to complex. Web front-ends that can be seen everywhere can be developed with Vue.
4. Vue is fast to get started, powerful, and provides a very easy-to-use scaffolding vue-cli, which makes it easy to build and run your own projects.
This article ends here. For more information about vue.js, you can refer to the vue.js tutorials related to the Video Tutorial column on the php Chinese website to learn.
The above is the detailed content of What is vue.js? What is the use?. For more information, please follow other related articles on the PHP Chinese website!