Skip to content
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

propTypes not transformed to vue #14

Open
armano2 opened this issue Jul 30, 2017 · 1 comment
Open

propTypes not transformed to vue #14

armano2 opened this issue Jul 30, 2017 · 1 comment

Comments

@armano2
Copy link

armano2 commented Jul 30, 2017

https://goo.gl/Wq1fxi

example:

import React from 'react';

class Display extends React.Component {
  render() {
    return (
      <div className="component-display">
        <div>
          {this.props.value}
        </div>
      </div>
    );
  }
}
Display.propTypes = {
  value: React.PropTypes.string,
};
export default Display;

propTypes can be used to make 2 thinks in react:

  1. events in vue
  2. props in vue

we can determine this based on value of property if its React.PropTypes.func than this is an $emit

@nickmessing
Copy link
Member

Hmm, looks possible with ComponentName.propTypes = {} and static propTypes = {}... I think we can use that as props index and use this.$props instead of this.$attrs, what do you think @egoist?

P.S. using on* for events is what I'd like to do since in Vue JSX this is the delimiter between event and prop so if you pass a prop like myCallback={(data) => console.log(data)} it will be a prop instead of event.

@armano2 armano2 changed the title propTypes not transformed to vue to propTypes not transformed to vue Jan 26, 2021
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

2 participants