{"id":5529,"date":"2022-12-18T11:00:34","date_gmt":"2022-12-18T11:00:34","guid":{"rendered":"https:\/\/tuvoc.com\/?p=5529"},"modified":"2024-11-05T09:44:21","modified_gmt":"2024-11-05T09:44:21","slug":"reactivity-vue-2-vs-vue-3","status":"publish","type":"post","link":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/","title":{"rendered":"Reactivity Vue 2 vs Vue 3"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Reactivity has to be one of the most stand-out features of Vue. The feature allows this <strong><a href=\"\/blog\/top-3-javascript-frameworks-in-2022-overview-comparison\/\">JavaScript framework<\/a><\/strong> to build interactive user interfaces for their front end, and the best part is, you don&#8217;t have to understand how it works, for it to work!<\/span><\/p>\n<div class=\"flex max-w-full flex-col flex-grow\">\n<div data-message-author-role=\"assistant\" data-message-id=\"4044625a-5fdc-49df-9c47-c09ccce961b0\" dir=\"auto\" class=\"min-h-8 text-message flex w-full flex-col items-end gap-2 whitespace-normal break-words [.text-message+&amp;]:mt-5\" data-message-model-slug=\"gpt-4o-mini\">\n<div class=\"flex w-full flex-col gap-1 empty:hidden first:pt-[3px]\">\n<div class=\"markdown prose w-full break-words dark:prose-invert dark\">\n<p>But if you are looking into more advanced Vue development, getting into features like the Composition API and understanding how reactivity works behind the curtains will help a lot. Today, we will explore the reactivity and compare the reactivity in Vue 2 vs. Vue 3. If you\u2019re interested in leveraging these advancements, make sure to <a href=\"https:\/\/www.tuvoc.com\/hire-vue-js-developer\/\"><strong>hire Vue JS developers India<\/strong><\/a> for their expertise and skills.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h2><span style=\"font-weight: 600;\">What Is Reactivity?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Reactivity is a programming pattern that allows the adjustment to the changes in a declarative manner. Here is how it offers a magic function, with a quick example.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Suppose you are working on an excel sheet that looks something like this:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td><b>A<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>1<\/b><\/td>\n<td><span style=\"font-weight: 400;\">5<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>2<\/b><\/td>\n<td><span style=\"font-weight: 400;\">3<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>3<\/b><\/td>\n<td><span style=\"font-weight: 400;\">8<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">Now, the A3 cell is defined by the function A1+A2. When you change the values in A1 and A2, the values in A3 will change automatically.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The caveat here is, that this does not happen in vanilla JavaScript.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If the variables in JavaScript are defined as 1 and 2, the A3 will give you an output of 3. However, if the values of A1 and A2 are changed, the A3 will not change automatically.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You will need to use the update function. The need here would be to invoke update(), whenever the dependencies (A1 and A2) are changed.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">whenDepsChange(update) will do the job for you. It will track the variable reading. When evaluating A1+A2, it will read both A1 and A2. Since both of them are read when update() is executed, the update() is subscribed to both A1 and A2 after the first call.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here, when a value is changed in A1 and A2, the re-run will occur by notifying all the subscribers to implement the change in the value.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">How does this help you with Vue and reactivity? Let&#8217;s find out.<\/span><\/p>\n<h2><span style=\"font-weight: 600;\">How Does Reactivity Work In Vue?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">In development, it would be impossible to track the reading and writing of local variables as we did in the example above. However, if we intercept the reading and writing of object properties, that can be done.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">With getter\/setters and Proxies, property access can be intercepted. Vue 2 uses getter\/setter as there are browser support limitations. Vue 3, on the other hand, uses getter\/setters for the refs and Proxies for reactive objects.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you are working with the data property &#8216;message&#8217; in the Vue component, and you are rendering this message in the view with text interpolation like this,<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">Vue.component(&#8220;my-component&#8221;, {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0data: {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0message: &#8220;Hello, world&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0template: &#8220;&lt;p&gt;{{ message }}&lt;\/p&gt;&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">});<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">You will see &lt;p&gt;Hello, world&lt;\/p&gt; when the app instantiates. But if you modify the message in the app lifecycle like this:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">methods: {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0updateMessage () {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0this.message = &#8220;Goodbye, world&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">Here, Vue will update your message automatically as &lt;p&gt;Goodbye, world&lt;\/p&gt;. Once again, changing the dependencies will affect the outcome in the desired way, as we discussed earlier.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This is just one example of reactivity in Vue, but with the right understanding, the possibilities are endless. This can be applied for updates in DOM, calculations of a computed property, and other custom functionalities.<\/span><\/p>\n<h2><span style=\"font-weight: 600;\">Vue 2 Reactivity<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The reactivity in Vue 2 works by walking through each property, component prop, computed property, and everything that the user has declared on getters and setters, which will trigger the desired side effect when the dependencies are modified.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For example, let\u2019s explore this Vue component.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">const data = {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0id: 1,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0name: &#8220;X Item&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0price: 999<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Vue.component(&#8220;X-item&#8221;, { data });<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">Here, the data object would be walked through. The getters and setters will be added automatically, the ones who are responsible for reactivity.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This is how the data object of the component will look at the runtime:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<ul>\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">_ob_: Observer<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">id: 1<\/span><\/p>\n<p><span style=\"font-weight: 400;\">name: &#8220;X Item&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">price: &#8220;999&#8221;<\/span><\/p>\n<ul>\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">get id: reactiveGetter()<\/span><\/li>\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">set id: reactiveSetter(newVal)<\/span><\/li>\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">get name: reactiveGetter()<\/span><\/li>\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">set name: reactiveSetter(newVal)<\/span><\/li>\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">get price: reactiveGetter()<\/span><\/li>\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">set price: reactiveSetter(newVal)<\/span><\/li>\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">_proto_: object<\/span><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">The ES5 <\/span><b>Object.defineProperty()<\/b><span style=\"font-weight: 400;\"> is used by Vue to convert the data object properties into getters and setters. With getters and setters added, the modification in the data will re-render the side effect:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">methods: {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0onClick () {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0data.price = 1000; \/\/ triggers re-render of the component<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span style=\"font-weight: 600;\">Vue 2 Reactivity Limitations<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">When Vue 2 was designed, there was no way to observe the changes in the property in JavaScript. If you were to add any new property to the data object during the lifecycle, the automatic reactivity would not work. Because of the limitations of Object.defineProperty(), some data changes go undetected.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In our &#8216;X-Item&#8217; example above, if we were to add another dimension, a data property of &#8216;quantity&#8217; (qty), the new property would not be reactive. If you modify that quantity, it will not affect the output the way you might have intended.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">const data = {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0id: 1, \/\/ reactive<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0name: &#8220;X Item&#8221;, \/\/ reactive<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0price: 999 \/\/ reactive<\/span><\/p>\n<p><span style=\"font-weight: 400;\">};<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Vue.component(&#8220;my-item&#8221;, { data });<\/span><\/p>\n<p><span style=\"font-weight: 400;\">data.qty = 5 \/\/ will not be reactive<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">The property of \u2018quantity\u2019 will be added to the data object at the runtime, however, there will be no getter\/setters defined for that property, making it non-reactive.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">These non-reactive properties can cause problems and in the future, prove to be difficult to diagnose. Developers working with Vue 2 stay away from adding or removing data properties because of that.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Apart from that,<\/span> <span style=\"font-weight: 400;\">setting array items by index and modifying the length of an array would also result in data changes that Vue 2 will not be able to detect.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can, however, resolve it with the<\/span><b> Vue.set method<\/b><span style=\"font-weight: 400;\"> (Vue.set(data, &#8220;qty&#8221;, 5);) to add the reactive data property after instantiation. This, however, kills the purpose of reactivity since it is not automatic and you will have to remember to use it.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Vue also came up with the <\/span><b>Vue.observable()<\/b><span style=\"font-weight: 400;\"> API method to cover all properties, but it isn\u2019t even close to what Reactivity in Vue 3 offers. Let\u2019s move on to that now.<\/span><\/p>\n<h2><span style=\"font-weight: 600;\">Vue 3 Reactivity<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The biggest difference between Vue 2 vs Vue 3 reactivity is the dependencies on the reactivity features to convert the data into getters and setters. Vue 3 has \u2018Proxy\u2019 and \u2018Reflect\u2019 to build the reactivity.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In Vue 2, if it wasn\u2019t aware of all the dependencies of the data at the time of instantiation, you wouldn\u2019t get the desired output. Proxy and Reflect are here to mitigate those caveats in Vue 2 reactivity.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s understand the proxy first. If you want to order food from a restaurant, you can call them or order online on their website. Proxy, however, is like a food delivery app that will give you added information like live tracking of your food or seeing the reviews of the restaurants.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The proxy of Vue 3 will get you the best of both worlds. It wraps the objects you want to observe and any operations made on the objects during the runtime. Let&#8217;s understand it in terms of coding:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">let data = { message: &#8220;Hello, world&#8221; }; \/\/ object we want to make reactive<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const proxy = new Proxy(data, { \/\/ Declaring a new Proxy object to wrap that data<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0set (target, property, value) { \/\/ Declaring a set function<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0target[property] = value;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0console.log(target);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">});<\/span><\/p>\n<p><span style=\"font-weight: 400;\">proxy.message = &#8220;Goodbye, world&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/*<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Console:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0message: &#8220;Goodbye, world&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">*\/<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">Here, we have a data object we want to make reactive, declare a proxy to wrap the data, and the set function that will intercept set operations applied to the target data. With that, you can get desired output when the dependencies will be modified.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now, you can add new properties during the app lifecycle and they will be automatically reactive as the proxies are observing the whole object, unlike Vue 2.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">On the same lines, Reflect is an object that provides us with methods for interceptable JavaScript operations. They are the same methods you can use in your Proxy handler. The use of Reflect is to ensure the &#8216;this&#8217; element does not break when an object has values or functions inherited from another object. It allows the proxy to get the \u2018get\u2019 requests where \u2018this\u2019 will be unbreakable.<\/span><\/p>\n<h2><span style=\"font-weight: 600;\">Conclusion<\/span><\/h2>\n<p>The reactivity feature of Vue is a blessing for developers when they want desired side-effects of outputs out of dependencies automatically.<\/p>\n<p>Vue 2 featured getters and setters for reactivity, where the addition or subtraction of any kind of data property would not be read by Vue, and the results in the output would not reflect the data modification. Compared to that, Vue 3 uses proxies, where the whole data is observed and \u2018set\u2019 is used to make the additional components reactive.<\/p>\n<p>What we have discussed today is just a fraction of the utilities of what can be achieved with a feature like reactivity, what has changed in Vue 3 reactivity compared to Vue 2, and the limitations of the version.<\/p>\n<p>However, under the hood for both versions, reactivity functions on the same concept. If you are working with a <a href=\"https:\/\/www.tuvoc.com\/technologies\/front-end\/vue-js-development-company\/\"><strong>Vue JS development company India<\/strong><\/a>, transitioning from Vue 2 to Vue 3 would be smooth, and the additional APIs won\u2019t be a hurdle.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reactivity has to be one of the most stand-out features of Vue. The feature allows this JavaScript framework to build interactive user interfaces for their front end, and the best part is, you don&rsquo;t have to understand how it works, for it to work! But if you are looking into more advanced Vue development, getting [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":5536,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[124,23],"tags":[],"class_list":["post-5529","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-app-development","category-tuvoc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Vue 2 vs Vue 3 Reactivity: Key Differences Overview<\/title>\n<meta name=\"description\" content=\"Learn how reactivity differs between Vue 2 and Vue 3, focusing on the shift from getters\/setters to proxies and enhanced data observation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vue 2 vs Vue 3 Reactivity: Key Differences Overview\" \/>\n<meta property=\"og:description\" content=\"Learn how reactivity differs between Vue 2 and Vue 3, focusing on the shift from getters\/setters to proxies and enhanced data observation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/\" \/>\n<meta property=\"og:site_name\" content=\"Tuvoc Technologies\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/tuvoctechnologies\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-18T11:00:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-05T09:44:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2022\/12\/Reactivity-vue-2-vs-vue-3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"3617\" \/>\n\t<meta property=\"og:image:height\" content=\"2320\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Meet Rathod\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Tuvocpvtltd\" \/>\n<meta name=\"twitter:site\" content=\"@Tuvocpvtltd\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Meet Rathod\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/\"},\"author\":{\"name\":\"Meet Rathod\",\"@id\":\"https:\/\/www.tuvoc.com\/#\/schema\/person\/e856942744869e569b53b40969c84c6e\"},\"headline\":\"Reactivity Vue 2 vs Vue 3\",\"datePublished\":\"2022-12-18T11:00:34+00:00\",\"dateModified\":\"2024-11-05T09:44:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/\"},\"wordCount\":1514,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.tuvoc.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2022\/12\/Reactivity-vue-2-vs-vue-3.png\",\"articleSection\":[\"App Development\",\"Tuvoc\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/\",\"url\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/\",\"name\":\"Vue 2 vs Vue 3 Reactivity: Key Differences Overview\",\"isPartOf\":{\"@id\":\"https:\/\/www.tuvoc.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2022\/12\/Reactivity-vue-2-vs-vue-3.png\",\"datePublished\":\"2022-12-18T11:00:34+00:00\",\"dateModified\":\"2024-11-05T09:44:21+00:00\",\"description\":\"Learn how reactivity differs between Vue 2 and Vue 3, focusing on the shift from getters\/setters to proxies and enhanced data observation.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#primaryimage\",\"url\":\"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2022\/12\/Reactivity-vue-2-vs-vue-3.png\",\"contentUrl\":\"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2022\/12\/Reactivity-vue-2-vs-vue-3.png\",\"width\":3617,\"height\":2320,\"caption\":\"Reactivity vue 2 vs vue 3\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.tuvoc.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Reactivity Vue 2 vs Vue 3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tuvoc.com\/#website\",\"url\":\"https:\/\/www.tuvoc.com\/\",\"name\":\"Tuvoc Technologies\",\"description\":\"Top Secure Web &amp; Mobile Application Development Company\",\"publisher\":{\"@id\":\"https:\/\/www.tuvoc.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.tuvoc.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.tuvoc.com\/#organization\",\"name\":\"Tuvoc Technologies\",\"url\":\"https:\/\/www.tuvoc.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.tuvoc.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2023\/07\/Tuvoc-1.svg\",\"contentUrl\":\"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2023\/07\/Tuvoc-1.svg\",\"width\":1,\"height\":1,\"caption\":\"Tuvoc Technologies\"},\"image\":{\"@id\":\"https:\/\/www.tuvoc.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/tuvoctechnologies\/\",\"https:\/\/x.com\/Tuvocpvtltd\",\"https:\/\/www.instagram.com\/tuvocpvtltd\/\",\"https:\/\/www.linkedin.com\/company\/tuvoc-technologies\/people\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.tuvoc.com\/#\/schema\/person\/e856942744869e569b53b40969c84c6e\",\"name\":\"Meet Rathod\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.tuvoc.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a5ea7fe4b22d6c0f6789de3313fe2471?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a5ea7fe4b22d6c0f6789de3313fe2471?s=96&d=mm&r=g\",\"caption\":\"Meet Rathod\"},\"url\":\"https:\/\/www.tuvoc.com\/author\/meet_rathod\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Vue 2 vs Vue 3 Reactivity: Key Differences Overview","description":"Learn how reactivity differs between Vue 2 and Vue 3, focusing on the shift from getters\/setters to proxies and enhanced data observation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/","og_locale":"en_US","og_type":"article","og_title":"Vue 2 vs Vue 3 Reactivity: Key Differences Overview","og_description":"Learn how reactivity differs between Vue 2 and Vue 3, focusing on the shift from getters\/setters to proxies and enhanced data observation.","og_url":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/","og_site_name":"Tuvoc Technologies","article_publisher":"https:\/\/www.facebook.com\/tuvoctechnologies\/","article_published_time":"2022-12-18T11:00:34+00:00","article_modified_time":"2024-11-05T09:44:21+00:00","og_image":[{"width":3617,"height":2320,"url":"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2022\/12\/Reactivity-vue-2-vs-vue-3.png","type":"image\/png"}],"author":"Meet Rathod","twitter_card":"summary_large_image","twitter_creator":"@Tuvocpvtltd","twitter_site":"@Tuvocpvtltd","twitter_misc":{"Written by":"Meet Rathod","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#article","isPartOf":{"@id":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/"},"author":{"name":"Meet Rathod","@id":"https:\/\/www.tuvoc.com\/#\/schema\/person\/e856942744869e569b53b40969c84c6e"},"headline":"Reactivity Vue 2 vs Vue 3","datePublished":"2022-12-18T11:00:34+00:00","dateModified":"2024-11-05T09:44:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/"},"wordCount":1514,"commentCount":0,"publisher":{"@id":"https:\/\/www.tuvoc.com\/#organization"},"image":{"@id":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#primaryimage"},"thumbnailUrl":"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2022\/12\/Reactivity-vue-2-vs-vue-3.png","articleSection":["App Development","Tuvoc"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/","url":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/","name":"Vue 2 vs Vue 3 Reactivity: Key Differences Overview","isPartOf":{"@id":"https:\/\/www.tuvoc.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#primaryimage"},"image":{"@id":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#primaryimage"},"thumbnailUrl":"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2022\/12\/Reactivity-vue-2-vs-vue-3.png","datePublished":"2022-12-18T11:00:34+00:00","dateModified":"2024-11-05T09:44:21+00:00","description":"Learn how reactivity differs between Vue 2 and Vue 3, focusing on the shift from getters\/setters to proxies and enhanced data observation.","breadcrumb":{"@id":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#primaryimage","url":"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2022\/12\/Reactivity-vue-2-vs-vue-3.png","contentUrl":"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2022\/12\/Reactivity-vue-2-vs-vue-3.png","width":3617,"height":2320,"caption":"Reactivity vue 2 vs vue 3"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tuvoc.com\/blog\/reactivity-vue-2-vs-vue-3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.tuvoc.com\/"},{"@type":"ListItem","position":2,"name":"Reactivity Vue 2 vs Vue 3"}]},{"@type":"WebSite","@id":"https:\/\/www.tuvoc.com\/#website","url":"https:\/\/www.tuvoc.com\/","name":"Tuvoc Technologies","description":"Top Secure Web &amp; Mobile Application Development Company","publisher":{"@id":"https:\/\/www.tuvoc.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tuvoc.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.tuvoc.com\/#organization","name":"Tuvoc Technologies","url":"https:\/\/www.tuvoc.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tuvoc.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2023\/07\/Tuvoc-1.svg","contentUrl":"https:\/\/www.tuvoc.com\/wp-content\/uploads\/2023\/07\/Tuvoc-1.svg","width":1,"height":1,"caption":"Tuvoc Technologies"},"image":{"@id":"https:\/\/www.tuvoc.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/tuvoctechnologies\/","https:\/\/x.com\/Tuvocpvtltd","https:\/\/www.instagram.com\/tuvocpvtltd\/","https:\/\/www.linkedin.com\/company\/tuvoc-technologies\/people\/"]},{"@type":"Person","@id":"https:\/\/www.tuvoc.com\/#\/schema\/person\/e856942744869e569b53b40969c84c6e","name":"Meet Rathod","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tuvoc.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a5ea7fe4b22d6c0f6789de3313fe2471?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a5ea7fe4b22d6c0f6789de3313fe2471?s=96&d=mm&r=g","caption":"Meet Rathod"},"url":"https:\/\/www.tuvoc.com\/author\/meet_rathod\/"}]}},"_links":{"self":[{"href":"https:\/\/www.tuvoc.com\/wp-json\/wp\/v2\/posts\/5529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tuvoc.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tuvoc.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tuvoc.com\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tuvoc.com\/wp-json\/wp\/v2\/comments?post=5529"}],"version-history":[{"count":0,"href":"https:\/\/www.tuvoc.com\/wp-json\/wp\/v2\/posts\/5529\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tuvoc.com\/wp-json\/wp\/v2\/media\/5536"}],"wp:attachment":[{"href":"https:\/\/www.tuvoc.com\/wp-json\/wp\/v2\/media?parent=5529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tuvoc.com\/wp-json\/wp\/v2\/categories?post=5529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tuvoc.com\/wp-json\/wp\/v2\/tags?post=5529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}