Giter Club home page Giter Club logo

vue3-vite-demo's Introduction

vue3-vite-demo

该项目主要用于学习vue3新特性

  • setup 函数中获取不到this,在其他vue3钩子函数可以获取到this,但此时this是一个Proxy对象,vue2.x是一个vue组件实例对象

  • vue2和vue3中$attrs行为不同,$listeners 对象在 Vue 3 中已被移除,现在事件监听器是 $attrs 的一部分,在vue2中,$attrs包含传给组件不被 prop 被识别 (且获取) 的 attribute 绑定 (class 和 style 除外),vue3中$attr包括了class、style、事件监听器(变成以on开头)、传给组件不被 prop 被识别 (且获取) 的 attribute

  • 自定义组件绑定原生事件行为不同,vue2中<Test @click="onClick" />点击组件不会执行,需要加native修饰符,在vue3中去不需要,就可以直接执行

  • vue3整合vue2组件报错 preview

vue3-vite-demo's People

Contributors

chenguzhen87 avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.