Original article: http://blog.kueiapp.com/programming-tw/vuejs-mvvm-VueJS-MVVM-Model and -Pure-HTML5-Comparison/
There are many methods and frameworks to build web front-end systems, such as React, AngularJS, Vue.js, etc. It's absolutely possible to build a system using native HTML5 and JavaScript, but usually using a good framework can implement the system with better design patterns in terms of structure and security.
A tool or architecture is usually created because developers have encountered certain difficulties. For example, jQuery was invented to use JavaScript on browsers that support different standards, and it was the first library to control the DOM (Document Object Modal) using CSS selectors. The HTML5 querySelector replicates this cool feature to make it easier for HTML to manipulate the DOM.
When using Pure HTML5 JavaScript to access the DOM to grab data from the HTML tree, there is a lot of work that needs to be done, such as targeting elements, adding listeners to detect user interactions on the UI, or when the target action is captured Returning data when retrieving it is actually very resource intensive.
Checkbox with pure HTML5 syntax
Compared with native HTML5 JavaScript (or jQuery) that directly operates the DOM, Vue.js has its own MVVM model that can modify the DOM while obtaining a new data model. In other words, we can focus on data structure rather than designing our own model to directly manipulate the DOM.
Both approaches are suitable for different situations, but Vue.js actually provides an easier path to building a web frontend.
export default Vue.extend({ data: () => ({ checkboxList: [], }), });
https://github.com/kueiapp/vue-typescript-tutorial/blob/main/src/App.vue
Original article: http://blog.kueiapp.com/programming-tw/vuejs-mvvm-VueJS-MVVM-Model and -Pure-HTML5-Comparison/
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3