search
HomeWeb Front-endVue.jsWhat are the new features of vue3.0
What are the new features of vue3.0Mar 19, 2021 pm 01:52 PM
new features

New features of vue3.0: 1. Node tag; 2. Event caching; 3. Responsive Proxy; 4. Composition API; 5. Three new components: Fragment, Teleport (portal) and Suspense; 6. Tree Shaking and so on.

What are the new features of vue3.0

The operating environment of this tutorial: windows10 system, vue3.0 version, Dell G3 computer.

New features of Vue3.0

##1. Node tag

Static Node

<span>value</span>
Dynamic Node

<span>{{value}}</span>patchFlag
The bottom layer of vue3.0 will automatically identify whether a node is dynamic. If it is dynamic, it will automatically generate an identification (different dynamics will have Corresponding to different identifiers, such as the dynamics of the content text, or the dynamics of the id), each time the DOM is updated, the static nodes are directly skipped and the dynamic nodes are directly positioned, which greatly saves efficiency.

2. Event caching

What are the new features of vue3.0

Generally, the listening time is set for a node, and each page When updating, a new listening function will be regenerated. If cacheHandlers is enabled, it will automatically identify whether it can be cached when it is updated for the first time. If it can be cached, it will be cached so that page updates do not need to be regenerated, especially when On components, it greatly reduces unnecessary refresh and resource consumption of sub-components.

3. Responsive Proxy

Proxy(vue3.0) vs Object.defineProperty (vue2.0)

1. Vue2.0 responsive principle

  • The responsive process needs to traverse data, props, etc., which consumes a lot of money

  • Does not support Set/Map , class, array and other types

  • Newly added or deleted attributes cannot be monitored

  • Array responsiveness requires additional implementation

  • The corresponding modification syntax is limited

2. Vue3.0 responsive principle: Use ES6 Proxy to solve these problems.

Use Proxy to intercept a series of operations on data.

4. Composition API

Don’t use Composition for the sake of Composition

Improves the quality of the code upper limit, but it also lowers the lower limit

is positioned as an advanced feature because the problems it is designed to solve mainly arise in large applications.

We are not planning to overhaul the documentation to use this as the default scheme.

Related recommendations: "

vue.js Tutorial"

5. Teleport

Modal, Dialog, Select, Dropdown...

What are the new features of vue3.0

##6. Fragments

What are the new features of vue3.0The template does not need to be wrapped with a p, that is, there is no need to have only one root node. Multiple labels (nodes) can be paralleled

7. Custom Renderer API (createRenderer)

    NativeScript Vue integration underway by @rigor789
  • Users already experimenting w/ WebGL custom renderer that can be used alongside a normal Vue application (Vugel)
  • WEEX, Vue Native, applet...

8. Tree ShakingLoading on demand

Except for retaining some necessary parts such as Virtual DOM update algorithm and responsive system, others are loaded on demand such as v-model, etc.

9. Suspense

    Wait on nested async dependencies in a nested tree
  • Works with async setup()
  • Works with Aysnc Components
  • You can load components asynchronously, and the entire DOM will be in memory in advance Virtual rendering is performed in the UI. At this time, it will wait for asynchronous component rendering. After all components are rendered, it will be rendered to the interface DOM.

10. Better TypeScript Support

##Codebase written in TS w/ auto-generated type definitions
  • API is the same in JS and TS
  • In fact, code will also be largely the same

    TSX support
  • Class component is still supported
  • ##11. Stepping into pitfalls

Event

    The root node is automatically mounted by default and xxx.native event is discarded
  • inheritAttrs: false (class, style, events, css scope)

      The settings are not mounted to the root node by default, but this will result in classes etc. not being mounted to the root node
    1. props

    2. Set the event attribute declaration in the component.

    New emits configuration

  • Slot

##[External link image transfer failed, the origin site may There is an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-McvPeqpz-1606459132262) (C:\Users\20194\AppData\Roaming\Typora\typora-user-images\image-20201127104234202.png)]

  • watch

    What are the new features of vue3.0

What are the new features of vue3.0##In vue3.0, you can configure flush: " sync" to make the functions in the watch and the monitored element value changes at the same time, and no longer execute after the component is updated.

    v-model & .sync

  • What are the new features of vue3.0

    ##JSX / TSX
  • 1、@ant- design-vue / jsx

    It used to be that some properties needed to be passed through objects. Now that properties are newly defined, you can pass them directly


    What are the new features of vue3.0# #For more programming-related knowledge, please visit:

    programming video
  • ! !

The above is the detailed content of What are the new features of vue3.0. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP 8.3发布:新特性一览PHP 8.3发布:新特性一览Nov 27, 2023 pm 12:52 PM

PHP8.3发布:新特性一览随着技术的不断发展和需求的不断变化,编程语言也在不断更新和改进。作为一种广泛应用于网络开发的脚本语言,PHP一直在不断进步,为开发者提供更强大和高效的工具。最近发布的PHP8.3版本带来了许多期待已久的新特性和改进,下面让我们来看一下这些新特性的一览。非空属性的初始化在过去的PHP版本中,如果一个类的属性没有被明确赋值,它的值

学习PHP8的新特性,深入理解最新技术的指南学习PHP8的新特性,深入理解最新技术的指南Dec 23, 2023 pm 01:16 PM

深入解析PHP8的新特性,助您掌握最新技术随着时间的推移,PHP编程语言一直在不断演进和改进。最近发布的PHP8版本为开发者提供了许多令人兴奋的新特性和改进,为我们的开发工作带来了更多便利和效率。在本文中,我们将深入解析PHP8的新特性,并提供具体的代码示例,旨在帮助您更好地掌握这些最新的技术。JIT编译器PHP8引入了JIT(Just-In-Time)编

PHP8.1引入的新的Redis扩展PHP8.1引入的新的Redis扩展Jul 07, 2023 pm 09:41 PM

PHP8.1引入的新的Redis扩展随着互联网的快速发展,大量的数据需要进行存储和处理。为了提高数据处理的效率和性能,缓存成为了一个不可或缺的部分。而在PHP开发中,Redis作为一种高性能的键值对存储系统,被广泛应用于缓存和数据存储的场景。为了进一步提升Redis在PHP中的使用体验,PHP8.1引入了新的Redis扩展,本文将介绍这一扩展的新增功能,并给

php8有什么新特性php8有什么新特性Sep 25, 2023 pm 01:34 PM

php8新特性有JIT 编译器、类型推导、命名参数、联合类型、属性、错误处理改进、异步编程支持、新的标准库函数和匿名类的扩展等。详细介绍:1、JIT编译器,PHP8引入了JIT编译器,这是一个重要的性能改进,JIT编译器可以对一些高频执行的代码进行实时编译和优化,从而提高运行速度;2、类型推导,PHP8引入了类型推导功能,允许开发者在声明变量时自动推导出变量的类型等等。

CSS3的新特性一览:如何使用CSS3实现过渡效果CSS3的新特性一览:如何使用CSS3实现过渡效果Sep 09, 2023 am 11:27 AM

CSS3的新特性一览:如何使用CSS3实现过渡效果CSS3作为CSS的最新版本,在众多新特性中,最有趣和实用的应该是过渡效果(transition)。过渡效果可以让我们的页面在交互时更加平滑、漂亮,给用户带来良好的视觉体验。本文将介绍CSS3过渡效果的基本用法,并附带相应的代码示例。transition-property属性:指定需要过渡的CSS属性过渡效果

go语言有什么新特性go语言有什么新特性Aug 24, 2023 pm 01:36 PM

go语言的新特性有:1、Go模块,用于管理Go语言项目的依赖关系;2、错误处理,增加了一个新的错误类型error,使得错误处理更加灵活和简洁;3、上下文包,用于在goroutine之间传递请求范围的值;4、嵌入,即一个结构体可以嵌入到另一个结构体中;5、同步包,更好地控制goroutine之间的同步和通信;6、错误值,更好地区分不同类型的错误;7、泛型,让开发者编写更灵活。

CSS3的新特性一览:如何使用CSS3实现水平居中布局CSS3的新特性一览:如何使用CSS3实现水平居中布局Sep 09, 2023 pm 04:09 PM

CSS3的新特性一览:如何使用CSS3实现水平居中布局在网页设计和布局中,水平居中布局是一项常见的需求。过去,我们经常使用复杂的JavaScript或CSS技巧实现此目的。然而,CSS3引入了一些新的特性,使得水平居中布局更加简单和灵活。本文将介绍一些CSS3的新特性,并提供一些代码示例,演示如何使用CSS3实现水平居中布局。一、使用flexbox布局fle

PHP8底层开发原理解密:利用新特性提高代码性能和可靠性PHP8底层开发原理解密:利用新特性提高代码性能和可靠性Sep 10, 2023 pm 04:25 PM

PHP8作为最新版本的PHP编程语言,引入了许多新的特性和改进,在底层开发原理方面做了一些重要的改变。本文将深入探讨PHP8的底层开发原理,并分析如何利用新特性提高代码性能和可靠性。首先,我们来了解一下PHP8的一些重要的底层开发原理。PHP8引入了JIT(Just-In-Time)编译器,这是一个动态编译器,可以将PHP代码即时转换为本地机器码,并在执行时

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function