Coder Social home page Coder Social logo

how to bind event? about babel-plugin-jsx HOT 10 OPEN

vuejs avatar vuejs commented on July 19, 2024
how to bind event?

from babel-plugin-jsx.

Comments (10)

Lv777F avatar Lv777F commented on July 19, 2024 2

我研究了半天 好像只能

<Input {...{'onUpdate:value':(value)=>xxx=value}}/>

这么写?

from babel-plugin-jsx.

Amour1688 avatar Amour1688 commented on July 19, 2024

onClick will be ok

image

from babel-plugin-jsx.

Jokcy avatar Jokcy commented on July 19, 2024

hm... it's kind of strange that props work like a directive...

from babel-plugin-jsx.

Lv777F avatar Lv777F commented on July 19, 2024

请问如何监听update:value这种事件?

from babel-plugin-jsx.

JohnZengshi avatar JohnZengshi commented on July 19, 2024

我研究了半天 好像只能

<Input {...{'onUpdate:value':(value)=>xxx=value}}/>

这么写?

老哥,🐂🍺!

from babel-plugin-jsx.

hjyyang avatar hjyyang commented on July 19, 2024

像 @keyup.enter="onSubmit" 这种要怎么写呢?

from babel-plugin-jsx.

jackhe16 avatar jackhe16 commented on July 19, 2024

像 @keyup.enter="onSubmit" 这种要怎么写呢?

  onKeyup={(ev: KeyboardEvent) => {
    if (ev.key === 'Enter') {
      onSubmit();
    }
  }}

from babel-plugin-jsx.

hetchzhao avatar hetchzhao commented on July 19, 2024

针对自定义的事件该怎么写呢?比如chang,input......
image

我试了onInput,onChange,好像都不行,采用v-input会报错
image

from babel-plugin-jsx.

jackhe16 avatar jackhe16 commented on July 19, 2024

不知道你是怎么写的, onInput,onChange 应该是可以的, 需要 ctx.emit('change');

from babel-plugin-jsx.

hetchzhao avatar hetchzhao commented on July 19, 2024

不知道你是怎么写的, onInput,onChange 应该是可以的, 需要 ctx.emit('change');

解决了,引用Element Plus时,typescript会提示onInput方法不存在,通过// @ts-ignore可以临时解决这个问题
image

from babel-plugin-jsx.

Related Issues (20)

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.