Vue.js: Difference between revisions
Nonymous-raz (talk | contribs) m →Routing |
Corrected wrong latest release version number (even though the link to the changelog was stating the correct number) |
||
(363 intermediate revisions by more than 100 users not shown) | |||
Line 1: | Line 1: | ||
{{short description|Open-source JavaScript library for building user interfaces}} |
|||
{{Multiple issues| |
|||
{{ |
{{Use mdy dates|date=August 2019}} |
||
{{ |
{{Primary sources|date=July 2019}} |
||
}} |
|||
{{Infobox software |
{{Infobox software |
||
| name = Vue.js |
| name = Vue.js |
||
| logo = |
| logo = Vue.js Logo 2.svg |
||
| logo_upright = yes |
|||
| author = Evan You |
| author = Evan You |
||
| |
| developer = Evan You and the Core Team<ref>{{cite web |url=https://vuejs.org/about/team |title=Vue.js |website=vuejs.org}}</ref> |
||
| released = {{Start date and age|2014|2}}<ref>{{cite web |url=http://blog.evanyou.me/2014/02/11/first-week-of-launching-an-oss-project/ |title=First Week of Launching Vue.js |website=Evan You |access-date=March 11, 2017 |archive-date=February 5, 2019 |archive-url=https://web.archive.org/web/20190205111451/https://blog.evanyou.me/2014/02/11/first-week-of-launching-an-oss-project/ |url-status=live }}</ref> |
|||
| latest release version = 2.2.6 |
|||
| latest release |
| latest release version = 3.5.13 <ref>{{cite web |url=https://github.com/vuejs/core/blob/main/CHANGELOG.md#3512-2024-10-11%20at%20main%20%C2%B7%20vuejs/core |title=Changelog 3.5.13 (2024-11-15) |website=GitHub}}</ref> |
||
| latest release date = {{Start date and age|2024|10|11}} |
|||
| status = Active |
|||
| programming language = [[ |
| programming language = [[TypeScript]] |
||
| platform = [[ |
| platform = [[Web platform]] |
||
| size = 33.9 KB [[Minification (programming)|min]]+[[gzip]]<ref>{{cite web |title=@vue/runtime-dom v3.2.45 |url=https://bundlephobia.com/package/@vue/runtime-dom |access-date=2023-01-29 |website=Bundlephobia |language=en |archive-date=January 29, 2023 |archive-url=https://web.archive.org/web/20230129213124/https://bundlephobia.com/package/@vue/runtime-dom |url-status=live }}</ref> |
|||
| size = 76 KB production<br>240 KB development |
|||
| genre = [[JavaScript library]] |
| genre = [[JavaScript library]] |
||
| license = [[MIT License]]<ref name="license">{{cite web|title=vue/LICENSE|url=https://github.com/vuejs/ |
| license = [[MIT License]]<ref name="license">{{cite web |title=vue/LICENSE |url=https://github.com/vuejs/core/blob/dev/LICENSE |via=GitHub |work=Vue.js |access-date=April 17, 2017}}</ref> |
||
}} |
}} |
||
'''Vue.js''' (commonly referred to as '''Vue'''; pronounced "view"<ref name="introduction">{{cite web |title=Introduction |url=https://vuejs.org/guide/introduction.html |website=Vuejs.org |access-date=January 3, 2020 |language=en |archive-date=February 10, 2022 |archive-url=https://web.archive.org/web/20220210104313/https://vuejs.org/guide/introduction.html |url-status=live}}</ref>) is an open-source [[model–view–viewmodel]] front end [[JavaScript framework]] for building [[user interface]]s and [[single-page application]]s.{{refn|<ref>{{cite book |last1=Macrae |first1=Callum |title=Vue.js: Up and Running: Building Accessible and Performant Web Apps |date=2018 |publisher=[[O'Reilly Media]] |isbn=978-1-4919-9721-5 |url=https://books.google.com/books?id=bJpNDwAAQBAJ |language=en |access-date=August 9, 2019 |archive-date=May 30, 2024 |archive-url=https://web.archive.org/web/20240530045409/https://books.google.com/books?id=bJpNDwAAQBAJ |url-status=live}}</ref><ref>{{cite book |last1=Nelson |first1=Brett |title=Getting to Know Vue.js: Learn to Build Single Page Applications in Vue from Scratch |year=2018 |publisher=[[Apress]] |isbn=978-1-4842-3781-6 |url=https://books.google.com/books?id=mTpsDwAAQBAJ |language=en |access-date=August 9, 2019 |archive-date=May 30, 2024 |archive-url=https://web.archive.org/web/20240530045418/https://books.google.com/books?id=mTpsDwAAQBAJ |url-status=live}}</ref><ref>{{cite book |last1=Yerburgh |first1=Edd |title=Testing Vue.js Applications |date=2019 |publisher=[[Manning Publications]] |isbn=978-1-61729-524-9 |url=https://books.google.com/books?id=7-FAtAEACAAJ |language=en |access-date=August 9, 2019 |archive-date=May 30, 2024 |archive-url=https://web.archive.org/web/20240530045404/https://books.google.com/books?id=7-FAtAEACAAJ |url-status=live}}</ref><ref>{{cite book |last1=Freeman |first1=Adam |title=Pro Vue.js 2 |year=2018 |publisher=[[Apress]] |isbn=978-1-4842-3805-9 |url=https://books.google.com/books?id=HQFuDwAAQBAJ |language=en |access-date=August 9, 2019 |archive-date=May 30, 2024 |archive-url=https://web.archive.org/web/20240530045404/https://books.google.com/books?id=HQFuDwAAQBAJ |url-status=live}}</ref><ref>{{cite book |last1=Franklin |first1=Jack |last2=Wanyoike |first2=Michael |last3=Bouchefra |first3=Ahmed |last4=Silas |first4=Kingsley |last5=Campbell |first5=Chad A. |last6=Jacques |first6=Nilson |last7=Omole |first7=Olayinka |last8=Mulders |first8=Michiel |title=Working with Vue.js |year=2019 |publisher=[[SitePoint]] |isbn=978-1-4920-7144-0 |url=https://books.google.com/books?id=OKScDwAAQBAJ |language=en}}{{Dead link |date=May 2024 |bot=InternetArchiveBot |fix-attempted=yes}}</ref><ref name="introduction" />}} It was created by Evan You and is maintained by him and the rest of the active core team members.<ref>{{cite web |url=https://vuejs.org/about/team.html |title=Meet the Team |website=Vuejs.org |access-date=September 23, 2019 |language=en |archive-date=February 7, 2022 |archive-url=https://web.archive.org/web/20220207050948/https://vuejs.org/about/team.html |url-status=live}}</ref> |
|||
'''Vue.js''' (commonly referred to as '''Vue'''; pronounced {{IPA|{{IPAc-en|v|j|uː}}}}, like '''view''') is an [[Open-source software|open-source]] progressive [[JavaScript framework]] for building [[user interfaces]].<ref>{{Cite web|url=https://vuejs.org/v2/guide/#What-is-Vue-js|title=Introduction — Vue.js|access-date=2017-03-11|language=en}}</ref> Integration into projects that use other [[JavaScript library|JavaScript libraries]] is made easy with Vue because it is designed to be incrementally adoptable. Also, Vue is a capable [[Web application frameworks|web application framework]] that is able to power advanced [[single-page application]]s. |
|||
According to a 2016 JavaScript survey, Vue has an 89% developer satisfaction rating. Vue accumulates around 80 [[GitHub]] stars per day,<ref>{{Cite web|url=http://stateofjs.com/2016/frontend/|title=State Of JavaScript Survey Results: Front-end Frameworks|access-date=2017-03-11|language=en}}</ref><ref>{{Cite web|url=http://bestof.js.org/tags/framework/trending/last-12-months|title=Trending JavaScript Frameworks|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=2017-03-11}}</ref> and is the 14th most starred project on GitHub of all time.<ref>{{Cite web|url=https://github.com/search?p=2&q=stars%3A%3E1&s=stars&type=Repositories|title=Most Starred Repositories|last=|first=|date=|website=GitHub|archive-url=|archive-date=|dead-url=|access-date=2017-03-11}}</ref> |
|||
== Overview == |
== Overview == |
||
Vue.js features an incrementally adaptable architecture that focuses on declarative rendering and component composition. The core library is focused on the view layer only.<ref name="introduction" /> Advanced features required for complex applications such as [[routing]], [[state management]] and [[Build automation|build tooling]] are offered via officially maintained supporting libraries and packages.<ref>{{cite web |url=https://www.patreon.com/evanyou |title=Evan is creating Vue.js |work=Patreon |access-date=March 11, 2017 |language=en |archive-date=March 3, 2019 |archive-url=https://web.archive.org/web/20190303114124/https://www.patreon.com/evanyou |url-status=live }}</ref> |
|||
Vue.js is a popular [[JavaScript]] front-end framework that was built to organize and simplify web development. |
|||
It serves as V and lightly the C in an [[MVC architecture]] by allowing users to view live data updates and interact with the data through component specific methods (much like a controller). |
|||
The project focuses on making ideas in web UI development (components, declarative UI, hot-reloading, time-travel debugging, etc.) more approachable. It attempts to be less opinionated and thus easier for developers to pick up. |
|||
Vue.js allows for extending [[HTML]] with HTML attributes called directives.<ref>{{cite web |url=https://www.w3schools.com/whatis/whatis_vue.asp |title=What is Vue.js |website=W3Schools |access-date=January 21, 2020 |language=en |archive-date=January 22, 2020 |archive-url=https://web.archive.org/web/20200122074512/https://www.w3schools.com/whatis/whatis_vue.asp |url-status=live }}</ref> The directives offer functionality to HTML [[Application software|applications]], and come as either [[Builtin function|built-in]] or user defined directives. |
|||
Less opinionated allows for progressive adoptable: Vue.js core is a drop-in library that can be used in existing pages. It can be used in existing projects to add simple interactivity, or to replace [[jQuery]] and other templating languages and frameworks entirely. Sister libraries can allow Vue to be the base of the entire front end architecture.<ref>{{Cite web|url=https://www.patreon.com/evanyou|title=Evan is creating Vue.js {{!}} Patreon|work=Patreon|access-date=2017-03-11|language=en}}</ref> |
|||
== History == |
== History == |
||
Vue was created by Evan You after working for [[Google]] using [[AngularJS]] in several projects. He later summed up his thought process: "I figured, what if I could just extract the part that I really liked about Angular and build something really lightweight."<ref>{{cite news |url=https://betweenthewires.org/2016/11/03/evan-you/ |archive-url=https://web.archive.org/web/20170603052649/https://betweenthewires.org/2016/11/03/evan-you/ |url-status=dead |archive-date=June 3, 2017 |title=Evan You |date=November 3, 2016 |work=Between the Wires |access-date=August 26, 2017 |language=en}}</ref> The first source code commit to the project was dated July 2013, at which time it was originally named "Seed".<ref name=":2">{{Cite book |last=贾 |first=志杰 |title=剑指大前端全栈工程师 |last2=史 |first2=广 |last3=赵 |first3=东 |year=2023 |isbn=9787302617594 |language=zh-CN |trans-title=Aspiring Frontend: Full-Stack Engineer}}</ref> Vue was first publicly announced the following February, in 2014.<ref name=":0">{{Cite web |date=2014-02-03 |title=Vue.js: JavaScript MVVM made simple |url=https://news.ycombinator.com/item?id=7169288 |access-date=2023-01-29 |website=Hacker News |archive-date=January 29, 2023 |archive-url=https://web.archive.org/web/20230129215705/https://news.ycombinator.com/item?id=7169288 |url-status=live }}</ref><ref name=":1">{{Cite web |date=2014-02-11 |title=First Week of Launching Vue.js |url=http://blog.evanyou.me/2014/02/11/first-week-of-launching-an-oss-project/index.html |access-date=2023-01-29 |website=Evan You |archive-date=April 12, 2017 |archive-url=https://web.archive.org/web/20170412110312/http://blog.evanyou.me/2014/02/11/first-week-of-launching-an-oss-project/index.html |url-status=live }}</ref> |
|||
Vue was created by Evan You after working for [[Google]] on [[AngularJS]]. You later summed up his thought process, "I figured, what if I could just extract the part that I really liked about Angular and build something really lightweight without all the extra concepts involved?"<ref>{{Cite news|url=https://betweenthewires.org/between-the-wires-evan-you-cb56660bc8a4#.yeez3vpy1|title=Between the Wires {{!}} Evan You|date=2016-11-03|work=Between the Wires|access-date=2017-03-11}}</ref> |
|||
Version names are often derived from [[manga]] and [[anime]]. |
|||
Vue was originally released in February 2014 by Evan You. The project was posted on [[Hacker News]], Echo JS, and the ''/r/javascript'' [[Reddit|subreddit]] the day of its initial release. Within one day the project reached the frontpage of all three sites.<ref>{{Cite web|url=http://blog.evanyou.me/2014/02/11/first-week-of-launching-an-oss-project/index.html|title=First Week of Launching Vue.js|website=Evan You|access-date=2017-03-11}}</ref> |
|||
=== Versions === |
|||
More recently Vue was featured as a Rising star in GitHub having gained the most stars of any Open Source Project on the popular website. It recently clocked 2,793 Watchers, 48,505 Stars 6,340 Forks<ref name="GitHub">{{cite web|last1=You|first1=Evan|title=GitHub: VueJS/Vue|url=https://github.com/vuejs/vue|website=Vue JS GitHub Page|accessdate=29 March 2017}}</ref> which makes it among the most popular open source projects on GitHub in general having far surpassed other popular libraries such as [[Backbone.js]] (26,178) Angular 2 (22,471)<ref>{{cite web|url=https://github.com/search?utf8=✓&q=angular&type=|website=GitHub|accessdate=29 March 2017}}</ref> or even jQuery (44,104).<ref>{{cite web|title=jQuery GitHub Page|url=https://github.com/jquery/jquery|website=GitHub|accessdate=29 March 2017}}</ref> |
|||
{| class="wikitable" |
|||
|- |
|||
! Version !! Release date !! Title !! End of LTS !! End of Life |
|||
|- |
|||
|3.5 |
|||
|{{dts|2024-09-01}} |
|||
|[[Tengen Toppa Gurren Lagann]]<ref>{{cite web |date=September 1, 2024 |title=Announcing Vue 3.5 |url=https://blog.vuejs.org/posts/vue-3-5 |url-status=live |archive-url=https://web.archive.org/web/20240903133340/https://blog.vuejs.org/posts/vue-3-5 |archive-date=September 3, 2024 |access-date=October 25, 2024 |work=Vue.js}}</ref> |
|||
| |
|||
| |
|||
|- |
|||
|3.4 |
|||
|{{dts|2023-12-28}} |
|||
|[[Slam Dunk (manga)|Slam Dunk]]<ref>{{cite web |title=Announcing Vue 3.4 |url=https://blog.vuejs.org/posts/vue-3-4 |work=Vue.js |access-date=29 March 2024 |date=December 28, 2023 |archive-date=March 24, 2024 |archive-url=https://web.archive.org/web/20240324024208/https://blog.vuejs.org/posts/vue-3-4 |url-status=live }}</ref> |
|||
| |
|||
| |
|||
|- |
|||
| 3.3 || {{dts|2023-05-11}} || [[Rurouni Kenshin]]<ref>{{cite web |url=https://github.com/vuejs/vue-next/releases/tag/v3.3.0 |title=v3.3.0 Rurouni Kenshin |date=May 11, 2023 |via=GitHub |work=Vue.js |access-date=2023-05-12 |language=en |archive-date=December 13, 2023 |archive-url=https://web.archive.org/web/20231213191126/https://github.com/vuejs/core/releases/tag/v3.3.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 3.2 || {{dts|2021-08-05}} || [[The Quintessential Quintuplets|Quintessential Quintuplets]]<ref>{{cite web |url=https://github.com/vuejs/vue-next/releases/tag/v3.2.0 |title=v3.2.0 Quintessential Quintuplets |date=August 5, 2021 |via=GitHub |work=Vue.js |access-date=August 10, 2021 |language=en |archive-date=August 10, 2021 |archive-url=https://web.archive.org/web/20210810001705/https://github.com/vuejs/vue-next/releases/tag/v3.2.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 3.1 || {{dts|2021-06-07}} || [[Pluto (manga)|Pluto]]<ref>{{cite web |url=https://github.com/vuejs/vue-next/releases/tag/v3.1.0 |title=v3.1.0 Pluto |date=June 7, 2021 |via=GitHub |work=Vue.js |access-date=July 18, 2021 |language=en |archive-date=July 18, 2021 |archive-url=https://web.archive.org/web/20210718094551/https://github.com/vuejs/vue-next/releases/tag/v3.1.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 3.0 || {{dts|2020-09-18}} || [[One Piece]]<ref>{{cite web |url=https://github.com/vuejs/vue-next/releases/tag/v3.0.0 |title=v3.0.0 One Piece |date=September 18, 2020 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=September 19, 2020 |archive-url=https://web.archive.org/web/20200919013105/https://github.com/vuejs/vue-next/releases/tag/v3.0.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 2.7 || {{dts|2022-07-01}} || [[Naruto]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v2.7.0 |title=v2.7.0 Naruto |date=July 1, 2022 |via=GitHub |work=Vue.js |access-date=July 1, 2022 |language=en |archive-date=July 1, 2022 |archive-url=https://web.archive.org/web/20220701141335/https://github.com/vuejs/vue/releases/tag/v2.7.0 |url-status=live }}</ref> || {{dts|2023-12-31}} || {{dts|2023-12-31}} |
|||
|- |
|||
| 2.6 || {{dts|2019-02-04}} || [[Macross]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v2.6.0 |title=v2.6.0 Macross |date=February 4, 2019 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=November 11, 2020 |archive-url=https://web.archive.org/web/20201111182125/https://github.com/vuejs/vue/releases/tag/v2.6.0 |url-status=live }}</ref> || {{dts|2022-03-18}} || {{dts|2023-09-18}} |
|||
|- |
|||
| 2.5 || {{dts|2017-10-13}} || [[Level E]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v2.5.0 |title=v2.5.0 Level E |date=October 13, 2017 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=September 18, 2020 |archive-url=https://web.archive.org/web/20200918170329/https://github.com/vuejs/vue/releases/tag/v2.5.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 2.4 || {{dts|2017-07-13}} || [[Kill la Kill]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v2.4.0 |title=v2.4.0 Kill la Kill |date=July 13, 2017 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=November 9, 2020 |archive-url=https://web.archive.org/web/20201109042137/https://github.com/vuejs/vue/releases/tag/v2.4.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 2.3 || {{dts|2017-04-27}} || [[JoJo's Bizarre Adventure]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v2.3.0 |title=v2.3.0 JoJo's Bizarre Adventure |date=April 27, 2017 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=November 11, 2020 |archive-url=https://web.archive.org/web/20201111192047/https://github.com/vuejs/vue/releases/tag/v2.3.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 2.2 || {{dts|2017-02-26}} || [[Initial D]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v2.2.0 |title=v2.2.0 Initial D |date=February 26, 2017 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=April 13, 2021 |archive-url=https://web.archive.org/web/20210413135052/https://github.com/vuejs/vue/releases/tag/v2.2.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 2.1 || {{dts|2016-11-22}} || [[Hunter X Hunter]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v2.1.0 |title=v2.1.0 Hunter X Hunter |date=November 22, 2016 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=November 8, 2020 |archive-url=https://web.archive.org/web/20201108094602/https://github.com/vuejs/vue/releases/tag/v2.1.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 2.0 || {{dts|2016-09-30}} || [[Ghost in the Shell]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v2.0.0 |title=v2.0.0 Ghost in the Shell |date=September 30, 2016 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=October 27, 2020 |archive-url=https://web.archive.org/web/20201027193218/https://github.com/vuejs/vue/releases/tag/v2.0.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 1.0 || {{dts|2015-10-27}} || [[Neon Genesis Evangelion|Evangelion]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/1.0.0 |title=1.0.0 Evangelion |date=October 27, 2015 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=April 13, 2021 |archive-url=https://web.archive.org/web/20210413114912/https://github.com/vuejs/vue/releases/tag/1.0.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 0.12 || {{dts|2015-06-12}} || [[Dragon Ball]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/0.12.0 |title=0.12.0: Dragon Ball |date=June 12, 2015 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=April 13, 2021 |archive-url=https://web.archive.org/web/20210413135200/https://github.com/vuejs/vue/releases/tag/0.12.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 0.11 || {{dts|2014-11-07}} || [[Cowboy Bebop]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/0.11.0 |title=v0.11.0: Cowboy Bebop |date=November 7, 2014 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=April 13, 2021 |archive-url=https://web.archive.org/web/20210413135213/https://github.com/vuejs/vue/releases/tag/0.11.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 0.10 || {{dts|2014-03-23}} || [[Blade Runner]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v0.10.0 |title=v0.10.0: Blade Runner |date=March 23, 2014 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=April 13, 2021 |archive-url=https://web.archive.org/web/20210413135244/https://github.com/vuejs/vue/releases/tag/v0.10.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 0.9 || {{dts|2014-02-25}} || [[Animatrix]]<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v0.9.0 |title=v0.9.0: Animatrix |date=February 25, 2014 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=April 13, 2021 |archive-url=https://web.archive.org/web/20210413115026/https://github.com/vuejs/vue/releases/tag/v0.9.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 0.8 || {{dts|2014-01-27}} || {{n/a}}<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v0.8.0 |title=v0.8.0 |date=January 27, 2014 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=April 13, 2021 |archive-url=https://web.archive.org/web/20210413114929/https://github.com/vuejs/vue/releases/tag/v0.8.0 |url-status=live }}</ref> || colspan="2" | first version publicly announced<ref name=":0" /><ref name=":1" /> |
|||
|- |
|||
| 0.7 || {{dts|2013-12-24}} || {{n/a}}<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/v0.7.0 |title=v0.7.0 |date=December 24, 2013 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=April 13, 2021 |archive-url=https://web.archive.org/web/20210413114747/https://github.com/vuejs/vue/releases/tag/v0.7.0 |url-status=live }}</ref> || || |
|||
|- |
|||
| 0.6 || {{dts|2013-12-08}} || VueJS<ref>{{cite web |url=https://github.com/vuejs/vue/releases/tag/0.6.0 |title=0.6.0: VueJS |date=December 8, 2013 |via=GitHub |work=Vue.js |access-date=September 23, 2020 |language=en |archive-date=April 13, 2021 |archive-url=https://web.archive.org/web/20210413134939/https://github.com/vuejs/vue/releases/tag/0.6.0 |url-status=live }}</ref> || || |
|||
|} |
|||
When a new major is released ie v3.y.z, the last minor ie 2.x.y will become a LTS release for 18 months (bug fixes and security patches) and for the following 18 months will be in maintenance mode (security patches only).<ref>{{cite web |url=https://github.com/vuejs/roadmap |title=Vue Roadmap |via=GitHub |work=Vue.js |date=November 6, 2022 |language=en |access-date=December 10, 2021 |archive-date=December 10, 2021 |archive-url=https://web.archive.org/web/20211210095019/https://github.com/vuejs/roadmap |url-status=live }}</ref> |
|||
== Features == |
== Features == |
||
=== Templates === |
|||
Vue uses an [[HTML]]-based template syntax that allows you to declaratively bind the rendered [[Document Object Model|DOM]] to the underlying Vue instance’s data. All Vue templates are valid HTML that can be parsed by spec-compliant browsers and [[HTML parser]]s. Under the hood, Vue compiles the templates into Virtual DOM render functions. Combined with the reactivity system, Vue is able to intelligently figure out the minimal number of components to re-render and apply the minimal amount of DOM manipulation when the app state changes. |
|||
In Vue, you can use the template syntax or choose to directly write render functions using [[JSX (JavaScript)|JSX]]. In order to do so just replace the template option with a render function.<ref>{{Cite web|url=https://vuejs.org/v2/guide/syntax.html|title=Template Syntax — Vue.js|access-date=2017-03-11|language=en}}</ref> Render functions open up possibilities for powerful component-based patterns — for example, the new transition system is now completely component-based, using render functions internally.<ref>{{Cite web|url=https://medium.com/the-vue-point/vue-2-0-is-here-ef1f26acf4b8#77d9|title=Vue 2.0 is Here!|last=|first=|date=2016-09-30|website=The Vue Point|archive-url=|archive-date=|dead-url=|access-date=2017-03-11}}</ref> |
|||
=== Reactivity === |
|||
One of Vue’s most distinct features is the unobtrusive reactivity system. Models are just plain [[JavaScript]] objects. When you modify them, the view updates. It makes state management very simple and intuitive. Vue provides optimized re-rendering out of the box without you having to do anything. Each component keeps track of its reactive dependencies during its render, so the system knows precisely when to re-render, and which components to re-render.<ref>{{Cite web|url=https://vuejs.org/v2/guide/reactivity.html|title=Reactivity in Depth — Vue.js|access-date=2017-03-11|language=en}}</ref> |
|||
=== Components === |
=== Components === |
||
Vue components extend basic [[HTML element]]s to encapsulate reusable code. At a high level, components are custom elements to which the Vue's compiler attaches behavior. In Vue, a component is essentially a Vue instance with pre-defined options.<ref>{{cite web |url=https://vuejs.org/guide/essentials/component-basics.html |title=Components |website=Vuejs.org |access-date=March 11, 2017 |language=en |archive-date=February 10, 2022 |archive-url=https://web.archive.org/web/20220210121233/https://vuejs.org/guide/essentials/component-basics.html |url-status=live }}</ref> |
|||
The code snippet below contains an example of a Vue component. The component presents a button and prints |
The code snippet below contains an example of a Vue component. The component presents a button and prints the number of times the button is clicked: |
||
{{syntaxhighlight|lang= |
{{syntaxhighlight|lang=html|code= |
||
<template> |
|||
props: ["initial_count"], |
|||
<div id="tuto"> |
|||
data: function() {var q = {"count": 0}; return q;} , |
|||
<button-clicked v-bind:initial-count="0"></button-clicked> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
Vue.component('button-clicked', { |
|||
props: ['initialCount'], |
|||
data: () => ({ |
|||
count: 0, |
|||
}), |
|||
template: '<button v-on:click="onClick">Clicked <nowiki>{{ count }}</nowiki> times</button>', |
|||
computed: { |
|||
countTimesTwo() { |
|||
return this.count * 2; |
|||
} |
|||
}, |
|||
watch: { |
|||
count(newValue, oldValue) { |
|||
console.log(`The value of count is changed from ${oldValue} to ${newValue}.`); |
|||
} |
|||
}, |
|||
methods: { |
methods: { |
||
onClick() { |
|||
this.count += 1; |
|||
} |
} |
||
}, |
}, |
||
mounted |
mounted() { |
||
this.count = this. |
this.count = this.initialCount; |
||
} |
} |
||
}); |
}); |
||
new Vue({ |
|||
el: '#tuto', |
|||
}); |
|||
</script> |
|||
}} |
}} |
||
=== Templates === |
|||
Vue uses an [[HTML]]-based template syntax that allows binding the rendered [[Document Object Model|DOM]] to the underlying Vue instance's data. All Vue templates are valid HTML that can be parsed by specification-compliant browsers and HTML [[Parsing|parsers]]. Vue compiles the templates into [[virtual DOM]] render functions. A virtual Document Object Model (or "DOM") allows Vue to render components in its memory before updating the browser. Combined with the reactivity system, Vue can calculate the minimal number of components to re-render and apply the minimal amount of DOM manipulations when the app state changes. |
|||
<ref>{{cite news |last1=Jordan |first1=John |title=Vue Admin Template |url=https://themeselection.com/item/category/vuejs-admin-templates/ |access-date=16 July 2022}}</ref> |
|||
Vue users can use template syntax or choose to directly write render functions using hyperscript either through function calls or [[React (JavaScript library)#JSX|JSX]].<ref>{{cite web |url=https://vuejs.org/guide/essentials/template-syntax.html |title=Template Syntax |website=Vuejs.org |access-date=March 11, 2017 |language=en |archive-date=February 10, 2022 |archive-url=https://web.archive.org/web/20220210105315/https://vuejs.org/guide/essentials/template-syntax.html |url-status=live }}</ref> Render functions allow applications to be built from [[software components]].<ref>{{cite web |url=https://medium.com/the-vue-point/vue-2-0-is-here-ef1f26acf4b8#77d9 |title=Vue 2.0 is Here! |date=September 30, 2016 |website=The Vue Point |access-date=March 11, 2017 |archive-date=March 12, 2017 |archive-url=https://web.archive.org/web/20170312072632/https://medium.com/the-vue-point/vue-2-0-is-here-ef1f26acf4b8#77d9 |url-status=live }}</ref> |
|||
=== Reactivity === |
|||
Vue features a reactivity system that uses plain [[JavaScript]] objects and optimized re-rendering. Each component keeps track of its reactive dependencies during its render, so the system knows precisely when to re-render, and which components to re-render.<ref>{{cite web |url=https://vuejs.org/guide/extras/reactivity-in-depth.html |title=Reactivity in Depth |website=Vuejs.org |access-date=March 11, 2017 |language=en |archive-date=February 10, 2022 |archive-url=https://web.archive.org/web/20220210105118/https://vuejs.org/guide/extras/reactivity-in-depth.html |url-status=live }}</ref> |
|||
=== Transitions === |
=== Transitions === |
||
Vue provides a variety of ways to apply transition effects when items are inserted, updated, or removed from the [[Document Object Model|DOM]]. This includes tools to: |
Vue provides a variety of ways to apply transition effects when items are inserted, updated, or removed from the [[Document Object Model|DOM]]. This includes tools to: |
||
* |
* Automatically apply classes for [[Cascading Style Sheets|CSS]] transitions and animations |
||
* |
* Integrate third-party CSS animation libraries, such as Animate.css |
||
* |
* Use JavaScript to directly manipulate the DOM during transition hooks |
||
* |
* Integrate third-party JavaScript animation libraries, such as [[Velocity (JavaScript library)|Velocity.js]] |
||
When an element wrapped in a transition component is inserted or removed, this is what happens: |
When an element wrapped in a transition component is inserted or removed, this is what happens: |
||
# Vue will automatically sniff whether the target element has CSS transitions or animations applied. If it does, CSS transition classes will be added/removed at appropriate timings. |
# Vue will automatically sniff whether the target element has CSS transitions or animations applied. If it does, CSS transition classes will be added/removed at appropriate timings. |
||
# If the transition component provided JavaScript hooks, these hooks will be called at appropriate timings. |
# If the transition component provided JavaScript hooks, these hooks will be called at appropriate timings. |
||
# If no CSS transitions/animations are detected and no JavaScript hooks are provided, the DOM operations for insertion and/or removal will be executed immediately on next frame.<ref>{{ |
# If no CSS transitions/animations are detected and no JavaScript hooks are provided, the DOM operations for insertion and/or removal will be executed immediately on next frame.<ref>{{cite web |url=https://vuejs.org/guide/built-ins/transition.html |title=Transition Effects |website=Vuejs.org |access-date=March 11, 2017 |language=en |archive-date=December 13, 2023 |archive-url=https://web.archive.org/web/20231213191121/https://vuejs.org/guide/built-ins/transition.html |url-status=live }}</ref><ref>{{cite web |url=https://vuejs.org/guide/extras/animation.html |title=Transitioning State |website=Vuejs.org |access-date=March 11, 2017 |language=en |archive-date=February 10, 2022 |archive-url=https://web.archive.org/web/20220210105126/https://vuejs.org/guide/extras/animation.html |url-status=live }}</ref> |
||
=== Routing === |
=== Routing === |
||
A traditional disadvantage of [[single-page application]]s (SPAs) is the inability to share links to the exact "sub" page within a specific web page. Because SPAs serve their users only one URL-based response from the server (it typically serves index.html or index.vue), bookmarking certain screens or sharing links to specific sections is normally difficult if not impossible. To solve this problem, many client-side routers delimit their dynamic URLs with a "[[Shebang_(Unix)|hashbang]]" (#!), e.g. ''page.com/#!/''. However, with HTML5 most modern browsers support routing without hashbangs. |
|||
In a Single Page Application (SPA) one initial disadvantage was the inability to share links to the exact "sub" page within a specific web page. Because SPAs serve their users only one [[url]] based response from the server (it typically serves index.html or index.vue), saving bookmarks, or sharing links to a specific article would be impossible. To solve this problem front end routers provide artificial hash based URLs originally split by a hash-bang (#!) ''page.com/#!/'' with html5 most modern browsers support routing without the use of a hashbang. JavaScript Libraries like Vue provide an easy Interface to change what is displayed on the page based on the current URL path -- regardless of how it was changed (whether by emailed link, refresh, or in page links). Additionally, using a front-end router allows for the intentional transition of the browser path when certain browser events (i.e. clicks) occur on buttons or links. Vue itself doesn’t come with front-end hashed [[routing]]. But the open source "vue-router" package provides this API to change browser URL, use the back button (hash history), and email password reset or email verification links with authentication parameters provided in the URL. It supports mapping nested routes to nested components and offers fine-grained transition control. Creating a front end routed Single-Page Application with Vue + vue-router is made simple. With Vue, developers are already composing applications with small building blocks building larger components. With vue-router, added to the mix, components must merely be mapped to the routes they belong to, and parent/root routes must indicate where children should render.<ref>{{Cite web|url=https://vuejs.org/v2/guide/routing.html|title=Routing — Vue.js|access-date=2017-03-11|language=en}}</ref> |
|||
Vue provides an interface to change what is displayed on the page based on the current URL path – regardless of how it was changed (whether by emailed link, refresh, or in-page links). Additionally, using a front-end router allows for the intentional transition of the browser path when certain browser events (i.e. clicks) occur on buttons or links. Vue itself doesn't come with front-end hashed routing. But the open-source "vue-router" package provides an API to update the application's URL, supports the back button (navigating history), and email password resets or email verification links with authentication URL parameters. It supports mapping nested routes to nested components and offers fine-grained transition control. With Vue, developers are already composing applications with small building blocks building larger components. With vue-router added to the mix, components must merely be mapped to the routes they belong to, and parent/root routes must indicate where children should render.<ref>{{cite web |url=https://vuejs.org/guide/scaling-up/routing.html |title=Routing |website=Vuejs.org |access-date=March 11, 2017 |language=en |archive-date=February 10, 2022 |archive-url=https://web.archive.org/web/20220210105119/https://vuejs.org/guide/scaling-up/routing.html |url-status=live }}</ref> |
|||
{{syntaxhighlight|lang=javascript|code= |
|||
{{syntaxhighlight|lang=html|code= |
|||
<div id="app"> |
<div id="app"> |
||
<router-view></router-view> |
<router-view></router-view> |
||
</div> |
</div> |
||
... |
|||
<script> |
|||
... |
|||
const User = { |
const User = { |
||
template: '<div>User {{ $route.params.id }}</div>' |
template: '<div>User <nowiki>{{ $route.params.id }}</nowiki></div>' |
||
} |
}; |
||
const router = new VueRouter({ |
const router = new VueRouter({ |
||
Line 95: | Line 176: | ||
{ path: '/user/:id', component: User } |
{ path: '/user/:id', component: User } |
||
] |
] |
||
}) |
}); |
||
... |
|||
</script> |
|||
}} |
}} |
||
The code above: |
The code above: |
||
# Sets a front-end route at |
# Sets a front-end route at <code>websitename.com/user/<id></code>. |
||
# Which will render in the User component defined in (const User...) |
# Which will render in the User component defined in (const User...) |
||
# Allows the User component to pass in the particular id of the user which was typed into the URL using the $route object's params key: |
# Allows the User component to pass in the particular id of the user which was typed into the URL using the $route object's params key: <code>$route.params.id</code>. |
||
# This template (varying by the params passed |
# This template (varying by the params passed into the router) will be rendered into <code><router-view></router-view></code> inside the DOM's div#app. |
||
# The finally generated HTML for someone typing in: |
# The finally generated HTML for someone typing in: <code>websitename.com/user/1</code> will be: |
||
{{syntaxhighlight|lang=html|code= |
{{syntaxhighlight|lang=html|code= |
||
<div id="app"> |
<div id="app"> |
||
Line 110: | Line 193: | ||
</div> |
</div> |
||
}} |
}} |
||
<ref>{{cite web|last1=You|first1=Evan|title=Vue Nested Routing (2)|url=https://router.vuejs.org/en/essentials/nested-routes.html|website=Vue Home Page (subpage)| |
<ref>{{cite web |last1=You |first1=Evan |title=Vue Nested Routing (2) |url=https://router.vuejs.org/en/essentials/nested-routes.html |website=Vue Home Page (subpage) |access-date=May 10, 2017 |archive-date=May 8, 2017 |archive-url=https://web.archive.org/web/20170508221910/http://router.vuejs.org/en/essentials/nested-routes.html |url-status=dead }}</ref> |
||
== |
== Ecosystem == |
||
The core library comes with tools and libraries both developed by the core team and contributors. |
|||
* vue-router<ref>{{Cite web|url=http://router.vuejs.org/en|title=vue-router|last=|first=|date=|website=router.vuejs.org|language=en|archive-url=|archive-date=|dead-url=|access-date=2017-03-11}}</ref> |
|||
* vuex<ref>{{Cite web|url=https://vuex.vuejs.org/en/|title=vuex|last=|first=|date=|website=vuex.vuejs.org|language=en|archive-url=|archive-date=|dead-url=|access-date=2017-03-11}}</ref> |
|||
=== Official tooling === |
|||
* vue-loader<ref>{{Cite web|url=https://vue-loader.vuejs.org/en/|title=vue-loader|last=|first=|date=|website=vue-loader.vuejs.org|language=en|archive-url=|archive-date=|dead-url=|access-date=2017-03-11}}</ref> |
|||
* '''Devtools''' – Browser devtools extension for debugging Vue.js applications |
|||
* vueify <ref>{{Cite web|url=https://github.com/vuejs/vueify|title=vueify|last=|first=|date=|website=GitHub|language=en|archive-url=|archive-date=|dead-url=|access-date=2017-03-11}}</ref> |
|||
* '''Vite''' – Standard Tooling for rapid Vue.js development |
|||
* vue-cli<ref>{{Cite web|url=https://github.com/vuejs/vue-cli|title=vue-cli|last=|first=|date=|website=GitHub|language=en|archive-url=|archive-date=|dead-url=|access-date=2017-03-11}}</ref> |
|||
* '''Vue Loader''' – a webpack loader that allows the writing of Vue components in a format called Single-File Components (SFCs) |
|||
=== Official libraries === |
|||
* '''Vue Router''' – The official router, suitable for building [[Single-page application|SPAs]]<ref name=":2" /> |
|||
* '''Vuex''' – Flux-inspired centralized state management system<ref>{{Cite book |last=Lau Tiam |first=Kok |title=Hands-on Nuxt.js Web Development: Build universal and static-generated Vue.js applications using Nuxt.js |isbn=9781789952698 |language=en}}</ref> |
|||
* '''Vue Server Renderer''' – Server-Side Rendering |
|||
* '''Pinia''' – New simple state management |
|||
== See also == |
== See also == |
||
{{portal|Free and open-source software}} |
|||
* [[Comparison of JavaScript frameworks]] |
|||
* [[ |
* [[Comparison of JavaScript-based web frameworks]] |
||
* [[React (software)|React]] |
|||
* [[AngularJS]] |
* [[AngularJS]] |
||
* [[ |
* [[Angular (web framework)|Angular]] |
||
* [[Quasar framework|Quasar Framework]] |
|||
* [[JavaScript library|JavaScript Library]] |
|||
* [[Web framework]] |
|||
* [[JavaScript library]] |
|||
* [[Model–view–viewmodel|Model–view–ViewModel]] |
|||
* [[Nuxt.js]] |
|||
== Sources == |
|||
{{Free-content attribution |
|||
|title= Vue.js Guide |
|||
|author = Vue.js |
|||
|documentURL= https://vuejs.org/guide/introduction.html |
|||
|license statement URL= https://github.com/vuejs/vuejs.org/blob/fdc66945e18020cdbdc729fd7ab8005d123216a7/LICENSE |
|||
|license= [[MIT License]] |
|||
}} |
|||
== References == |
== References == |
||
{{ |
{{reflist}} |
||
== External links == |
|||
* {{Official website}} |
|||
{{JS templating |state=autocollapse}} |
|||
{{Web frameworks}} |
|||
{{NodeJs}} |
|||
__FORCETOC__ |
__FORCETOC__ |
||
[[Category:2014 software]] |
|||
[[Category:JavaScript web frameworks]] |
[[Category:JavaScript web frameworks]] |
||
[[Category:Software using the MIT license]] |
|||
[[Category:Web development]] |
|||
[[Category:Web frameworks]] |
|||
[[Category:JavaScript libraries]] |
Latest revision as of 13:03, 4 December 2024
Original author(s) | Evan You |
---|---|
Developer(s) | Evan You and the Core Team[1] |
Initial release | February 2014[2] |
Stable release | 3.5.13 [3]
/ October 11, 2024 |
Repository | |
Written in | TypeScript |
Platform | Web platform |
Size | 33.9 KB min+gzip[4] |
Type | JavaScript library |
License | MIT License[5] |
Website | vuejs |
Vue.js (commonly referred to as Vue; pronounced "view"[6]) is an open-source model–view–viewmodel front end JavaScript framework for building user interfaces and single-page applications.[12] It was created by Evan You and is maintained by him and the rest of the active core team members.[13]
Overview
[edit]Vue.js features an incrementally adaptable architecture that focuses on declarative rendering and component composition. The core library is focused on the view layer only.[6] Advanced features required for complex applications such as routing, state management and build tooling are offered via officially maintained supporting libraries and packages.[14]
Vue.js allows for extending HTML with HTML attributes called directives.[15] The directives offer functionality to HTML applications, and come as either built-in or user defined directives.
History
[edit]Vue was created by Evan You after working for Google using AngularJS in several projects. He later summed up his thought process: "I figured, what if I could just extract the part that I really liked about Angular and build something really lightweight."[16] The first source code commit to the project was dated July 2013, at which time it was originally named "Seed".[17] Vue was first publicly announced the following February, in 2014.[18][19]
Version names are often derived from manga and anime.
Versions
[edit]Version | Release date | Title | End of LTS | End of Life |
---|---|---|---|---|
3.5 | September 1, 2024 | Tengen Toppa Gurren Lagann[20] | ||
3.4 | December 28, 2023 | Slam Dunk[21] | ||
3.3 | May 11, 2023 | Rurouni Kenshin[22] | ||
3.2 | August 5, 2021 | Quintessential Quintuplets[23] | ||
3.1 | June 7, 2021 | Pluto[24] | ||
3.0 | September 18, 2020 | One Piece[25] | ||
2.7 | July 1, 2022 | Naruto[26] | December 31, 2023 | December 31, 2023 |
2.6 | February 4, 2019 | Macross[27] | March 18, 2022 | September 18, 2023 |
2.5 | October 13, 2017 | Level E[28] | ||
2.4 | July 13, 2017 | Kill la Kill[29] | ||
2.3 | April 27, 2017 | JoJo's Bizarre Adventure[30] | ||
2.2 | February 26, 2017 | Initial D[31] | ||
2.1 | November 22, 2016 | Hunter X Hunter[32] | ||
2.0 | September 30, 2016 | Ghost in the Shell[33] | ||
1.0 | October 27, 2015 | Evangelion[34] | ||
0.12 | June 12, 2015 | Dragon Ball[35] | ||
0.11 | November 7, 2014 | Cowboy Bebop[36] | ||
0.10 | March 23, 2014 | Blade Runner[37] | ||
0.9 | February 25, 2014 | Animatrix[38] | ||
0.8 | January 27, 2014 | —[39] | first version publicly announced[18][19] | |
0.7 | December 24, 2013 | —[40] | ||
0.6 | December 8, 2013 | VueJS[41] |
When a new major is released ie v3.y.z, the last minor ie 2.x.y will become a LTS release for 18 months (bug fixes and security patches) and for the following 18 months will be in maintenance mode (security patches only).[42]
Features
[edit]Components
[edit]Vue components extend basic HTML elements to encapsulate reusable code. At a high level, components are custom elements to which the Vue's compiler attaches behavior. In Vue, a component is essentially a Vue instance with pre-defined options.[43] The code snippet below contains an example of a Vue component. The component presents a button and prints the number of times the button is clicked:
<template>
<div id="tuto">
<button-clicked v-bind:initial-count="0"></button-clicked>
</div>
</template>
<script>
Vue.component('button-clicked', {
props: ['initialCount'],
data: () => ({
count: 0,
}),
template: '<button v-on:click="onClick">Clicked {{ count }} times</button>',
computed: {
countTimesTwo() {
return this.count * 2;
}
},
watch: {
count(newValue, oldValue) {
console.log(`The value of count is changed from ${oldValue} to ${newValue}.`);
}
},
methods: {
onClick() {
this.count += 1;
}
},
mounted() {
this.count = this.initialCount;
}
});
new Vue({
el: '#tuto',
});
</script>
Templates
[edit]Vue uses an HTML-based template syntax that allows binding the rendered DOM to the underlying Vue instance's data. All Vue templates are valid HTML that can be parsed by specification-compliant browsers and HTML parsers. Vue compiles the templates into virtual DOM render functions. A virtual Document Object Model (or "DOM") allows Vue to render components in its memory before updating the browser. Combined with the reactivity system, Vue can calculate the minimal number of components to re-render and apply the minimal amount of DOM manipulations when the app state changes. [44] Vue users can use template syntax or choose to directly write render functions using hyperscript either through function calls or JSX.[45] Render functions allow applications to be built from software components.[46]
Reactivity
[edit]Vue features a reactivity system that uses plain JavaScript objects and optimized re-rendering. Each component keeps track of its reactive dependencies during its render, so the system knows precisely when to re-render, and which components to re-render.[47]
Transitions
[edit]Vue provides a variety of ways to apply transition effects when items are inserted, updated, or removed from the DOM. This includes tools to:
- Automatically apply classes for CSS transitions and animations
- Integrate third-party CSS animation libraries, such as Animate.css
- Use JavaScript to directly manipulate the DOM during transition hooks
- Integrate third-party JavaScript animation libraries, such as Velocity.js
When an element wrapped in a transition component is inserted or removed, this is what happens:
- Vue will automatically sniff whether the target element has CSS transitions or animations applied. If it does, CSS transition classes will be added/removed at appropriate timings.
- If the transition component provided JavaScript hooks, these hooks will be called at appropriate timings.
- If no CSS transitions/animations are detected and no JavaScript hooks are provided, the DOM operations for insertion and/or removal will be executed immediately on next frame.[48][49]
Routing
[edit]A traditional disadvantage of single-page applications (SPAs) is the inability to share links to the exact "sub" page within a specific web page. Because SPAs serve their users only one URL-based response from the server (it typically serves index.html or index.vue), bookmarking certain screens or sharing links to specific sections is normally difficult if not impossible. To solve this problem, many client-side routers delimit their dynamic URLs with a "hashbang" (#!), e.g. page.com/#!/. However, with HTML5 most modern browsers support routing without hashbangs.
Vue provides an interface to change what is displayed on the page based on the current URL path – regardless of how it was changed (whether by emailed link, refresh, or in-page links). Additionally, using a front-end router allows for the intentional transition of the browser path when certain browser events (i.e. clicks) occur on buttons or links. Vue itself doesn't come with front-end hashed routing. But the open-source "vue-router" package provides an API to update the application's URL, supports the back button (navigating history), and email password resets or email verification links with authentication URL parameters. It supports mapping nested routes to nested components and offers fine-grained transition control. With Vue, developers are already composing applications with small building blocks building larger components. With vue-router added to the mix, components must merely be mapped to the routes they belong to, and parent/root routes must indicate where children should render.[50]
<div id="app">
<router-view></router-view>
</div>
...
<script>
...
const User = {
template: '<div>User {{ $route.params.id }}</div>'
};
const router = new VueRouter({
routes: [
{ path: '/user/:id', component: User }
]
});
...
</script>
The code above:
- Sets a front-end route at
websitename.com/user/<id>
. - Which will render in the User component defined in (const User...)
- Allows the User component to pass in the particular id of the user which was typed into the URL using the $route object's params key:
$route.params.id
. - This template (varying by the params passed into the router) will be rendered into
<router-view></router-view>
inside the DOM's div#app. - The finally generated HTML for someone typing in:
websitename.com/user/1
will be:
<div id="app">
<div>
<div>User 1</div>
</div>
</div>
Ecosystem
[edit]The core library comes with tools and libraries both developed by the core team and contributors.
Official tooling
[edit]- Devtools – Browser devtools extension for debugging Vue.js applications
- Vite – Standard Tooling for rapid Vue.js development
- Vue Loader – a webpack loader that allows the writing of Vue components in a format called Single-File Components (SFCs)
Official libraries
[edit]- Vue Router – The official router, suitable for building SPAs[17]
- Vuex – Flux-inspired centralized state management system[52]
- Vue Server Renderer – Server-Side Rendering
- Pinia – New simple state management
See also
[edit]- Comparison of JavaScript-based web frameworks
- React
- AngularJS
- Angular
- Quasar Framework
- Web framework
- JavaScript library
- Model–view–ViewModel
- Nuxt.js
Sources
[edit]This article incorporates text from a free content work. Licensed under MIT License (license statement/permission). Text taken from Vue.js Guide, Vue.js.
References
[edit]- ^ "Vue.js". vuejs.org.
- ^ "First Week of Launching Vue.js". Evan You. Archived from the original on February 5, 2019. Retrieved March 11, 2017.
- ^ "Changelog 3.5.13 (2024-11-15)". GitHub.
- ^ "@vue/runtime-dom v3.2.45". Bundlephobia. Archived from the original on January 29, 2023. Retrieved January 29, 2023.
- ^ "vue/LICENSE". Vue.js. Retrieved April 17, 2017 – via GitHub.
- ^ a b c "Introduction". Vuejs.org. Archived from the original on February 10, 2022. Retrieved January 3, 2020.
- ^ Macrae, Callum (2018). Vue.js: Up and Running: Building Accessible and Performant Web Apps. O'Reilly Media. ISBN 978-1-4919-9721-5. Archived from the original on May 30, 2024. Retrieved August 9, 2019.
- ^ Nelson, Brett (2018). Getting to Know Vue.js: Learn to Build Single Page Applications in Vue from Scratch. Apress. ISBN 978-1-4842-3781-6. Archived from the original on May 30, 2024. Retrieved August 9, 2019.
- ^ Yerburgh, Edd (2019). Testing Vue.js Applications. Manning Publications. ISBN 978-1-61729-524-9. Archived from the original on May 30, 2024. Retrieved August 9, 2019.
- ^ Freeman, Adam (2018). Pro Vue.js 2. Apress. ISBN 978-1-4842-3805-9. Archived from the original on May 30, 2024. Retrieved August 9, 2019.
- ^ Franklin, Jack; Wanyoike, Michael; Bouchefra, Ahmed; Silas, Kingsley; Campbell, Chad A.; Jacques, Nilson; Omole, Olayinka; Mulders, Michiel (2019). Working with Vue.js. SitePoint. ISBN 978-1-4920-7144-0.[permanent dead link ]
- ^ [7][8][9][10][11][6]
- ^ "Meet the Team". Vuejs.org. Archived from the original on February 7, 2022. Retrieved September 23, 2019.
- ^ "Evan is creating Vue.js". Patreon. Archived from the original on March 3, 2019. Retrieved March 11, 2017.
- ^ "What is Vue.js". W3Schools. Archived from the original on January 22, 2020. Retrieved January 21, 2020.
- ^ "Evan You". Between the Wires. November 3, 2016. Archived from the original on June 3, 2017. Retrieved August 26, 2017.
- ^ a b 贾, 志杰; 史, 广; 赵, 东 (2023). 剑指大前端全栈工程师 [Aspiring Frontend: Full-Stack Engineer] (in Chinese (China)). ISBN 9787302617594.
- ^ a b "Vue.js: JavaScript MVVM made simple". Hacker News. February 3, 2014. Archived from the original on January 29, 2023. Retrieved January 29, 2023.
- ^ a b "First Week of Launching Vue.js". Evan You. February 11, 2014. Archived from the original on April 12, 2017. Retrieved January 29, 2023.
- ^ "Announcing Vue 3.5". Vue.js. September 1, 2024. Archived from the original on September 3, 2024. Retrieved October 25, 2024.
- ^ "Announcing Vue 3.4". Vue.js. December 28, 2023. Archived from the original on March 24, 2024. Retrieved March 29, 2024.
- ^ "v3.3.0 Rurouni Kenshin". Vue.js. May 11, 2023. Archived from the original on December 13, 2023. Retrieved May 12, 2023 – via GitHub.
- ^ "v3.2.0 Quintessential Quintuplets". Vue.js. August 5, 2021. Archived from the original on August 10, 2021. Retrieved August 10, 2021 – via GitHub.
- ^ "v3.1.0 Pluto". Vue.js. June 7, 2021. Archived from the original on July 18, 2021. Retrieved July 18, 2021 – via GitHub.
- ^ "v3.0.0 One Piece". Vue.js. September 18, 2020. Archived from the original on September 19, 2020. Retrieved September 23, 2020 – via GitHub.
- ^ "v2.7.0 Naruto". Vue.js. July 1, 2022. Archived from the original on July 1, 2022. Retrieved July 1, 2022 – via GitHub.
- ^ "v2.6.0 Macross". Vue.js. February 4, 2019. Archived from the original on November 11, 2020. Retrieved September 23, 2020 – via GitHub.
- ^ "v2.5.0 Level E". Vue.js. October 13, 2017. Archived from the original on September 18, 2020. Retrieved September 23, 2020 – via GitHub.
- ^ "v2.4.0 Kill la Kill". Vue.js. July 13, 2017. Archived from the original on November 9, 2020. Retrieved September 23, 2020 – via GitHub.
- ^ "v2.3.0 JoJo's Bizarre Adventure". Vue.js. April 27, 2017. Archived from the original on November 11, 2020. Retrieved September 23, 2020 – via GitHub.
- ^ "v2.2.0 Initial D". Vue.js. February 26, 2017. Archived from the original on April 13, 2021. Retrieved September 23, 2020 – via GitHub.
- ^ "v2.1.0 Hunter X Hunter". Vue.js. November 22, 2016. Archived from the original on November 8, 2020. Retrieved September 23, 2020 – via GitHub.
- ^ "v2.0.0 Ghost in the Shell". Vue.js. September 30, 2016. Archived from the original on October 27, 2020. Retrieved September 23, 2020 – via GitHub.
- ^ "1.0.0 Evangelion". Vue.js. October 27, 2015. Archived from the original on April 13, 2021. Retrieved September 23, 2020 – via GitHub.
- ^ "0.12.0: Dragon Ball". Vue.js. June 12, 2015. Archived from the original on April 13, 2021. Retrieved September 23, 2020 – via GitHub.
- ^ "v0.11.0: Cowboy Bebop". Vue.js. November 7, 2014. Archived from the original on April 13, 2021. Retrieved September 23, 2020 – via GitHub.
- ^ "v0.10.0: Blade Runner". Vue.js. March 23, 2014. Archived from the original on April 13, 2021. Retrieved September 23, 2020 – via GitHub.
- ^ "v0.9.0: Animatrix". Vue.js. February 25, 2014. Archived from the original on April 13, 2021. Retrieved September 23, 2020 – via GitHub.
- ^ "v0.8.0". Vue.js. January 27, 2014. Archived from the original on April 13, 2021. Retrieved September 23, 2020 – via GitHub.
- ^ "v0.7.0". Vue.js. December 24, 2013. Archived from the original on April 13, 2021. Retrieved September 23, 2020 – via GitHub.
- ^ "0.6.0: VueJS". Vue.js. December 8, 2013. Archived from the original on April 13, 2021. Retrieved September 23, 2020 – via GitHub.
- ^ "Vue Roadmap". Vue.js. November 6, 2022. Archived from the original on December 10, 2021. Retrieved December 10, 2021 – via GitHub.
- ^ "Components". Vuejs.org. Archived from the original on February 10, 2022. Retrieved March 11, 2017.
- ^ Jordan, John. "Vue Admin Template". Retrieved July 16, 2022.
- ^ "Template Syntax". Vuejs.org. Archived from the original on February 10, 2022. Retrieved March 11, 2017.
- ^ "Vue 2.0 is Here!". The Vue Point. September 30, 2016. Archived from the original on March 12, 2017. Retrieved March 11, 2017.
- ^ "Reactivity in Depth". Vuejs.org. Archived from the original on February 10, 2022. Retrieved March 11, 2017.
- ^ "Transition Effects". Vuejs.org. Archived from the original on December 13, 2023. Retrieved March 11, 2017.
- ^ "Transitioning State". Vuejs.org. Archived from the original on February 10, 2022. Retrieved March 11, 2017.
- ^ "Routing". Vuejs.org. Archived from the original on February 10, 2022. Retrieved March 11, 2017.
- ^ You, Evan. "Vue Nested Routing (2)". Vue Home Page (subpage). Archived from the original on May 8, 2017. Retrieved May 10, 2017.
- ^ Lau Tiam, Kok. Hands-on Nuxt.js Web Development: Build universal and static-generated Vue.js applications using Nuxt.js. ISBN 9781789952698.