
Vue creator Evan You has done a complete write up on the planned features of Vue 3
In simple terms, what are the new features of Vue 3 that you, as a developer, can use?
- Class-based components. Rather than declaring components with an object e.g.
Vue.component("my-component", { ... });
you can (optionally) use an ES2015 class. - Fragments. These are components with multiple root nodes e.g.
<template><root1/><root2/></template>
- Portals. These are subtrees of markup that can be rendered outside of Vue’s mount element.
- Functional components as plain functions. Not sure of the syntax yet, but maybe something like
function myComp(h) => h("div", "Hello, World");
- Improved reactivity. By utilizing ES2015, Vue 3 will eliminate current reactivity limitations. By utilizing new ES2015 features, Vue 3 will eliminate the current reactivity limitations i.e. will be able to detect any kind of object or array mutation and new data types like Maps and Sets can be reactive.
- TypeScript support. For example, you’ll be able to use TSX for render functions (JSX in TypeScript files).
Tags: