Vue3 learning record - (5) new features

1. Composition API

  • In Vue 2.x, the main logic of components is to write configuration-based components through some configuration items, which is called Options API (Configuration API)

insert image description here

  • One of the core new features of Vue 3 is the introduction of the Composition API (combined API), which allows most of the components to be configured through the setup() method
    insert image description here

2. Built-in components

The built-in components of Teleport, Suspense, and Fragments are new in Vue 3. Here, built-in components are referred to as components that can be directly written in it without additional introduction, and Fragments is a new feature that allows developers to use it without Mandatory wrapping a root element in

2. Server-side rendering

In terms of server-side rendering, Vue 3 optimizes the logic of returning HTML strings. In Vue 2.x, all nodes (including some static nodes) will be converted into virtual DOM when the server returns, and then converted into HTML strings and returned to the browser; Vue 3 strips static nodes into strings, which Part of the content will not be converted into virtual DOM, but will be spliced ​​back directly, improving efficiency

2. Main features of Vite

  • Fast cold start.
  • Instant module hot updates.
  • True on-demand compilation.

Guess you like

Origin blog.csdn.net/qq812457115/article/details/129167932