Skip to content

namespaced syntax (e.g., vOn:click) does not work with tsx #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
speigg opened this issue Mar 5, 2019 · 3 comments
Closed

namespaced syntax (e.g., vOn:click) does not work with tsx #52

speigg opened this issue Mar 5, 2019 · 3 comments

Comments

@speigg
Copy link

speigg commented Mar 5, 2019

Sadly, typescript does not support namespaced attributes. Periods (e.g.,vOn.click) will not work in TSX files either. Only options seem to be vOn_click and vOn-click.

@speigg speigg changed the title namespaced syntax (e.g., vOn:click) does not work with tsx files namespaced syntax (e.g., vOn:click) does not work with tsx Mar 5, 2019
@wujiiu
Copy link

wujiiu commented Apr 1, 2019

i had a similar problem with the difference is syntax is not supported on vscode
image

@nickmessing
Copy link
Member

Unfortunately TSX does not support namespaced attributes, there is no way around so I'm working on a different syntax in http://github.com/nickmessing/vue-tsx/

@snowyu
Copy link

snowyu commented Apr 22, 2019

do not use vOn:xxx on typescript, just

function handleClick(e) {...};
return <div onClick={handleClick}></div>

// Or 
return <div 
  {...{
    on: {
       ...this.$listener,
      click: handleClick
    }
  }}
></div

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants