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

Spread operator for intermediary component props #161

Closed
kvedantmahajan opened this issue Oct 29, 2018 · 2 comments
Closed

Spread operator for intermediary component props #161

kvedantmahajan opened this issue Oct 29, 2018 · 2 comments

Comments

@kvedantmahajan
Copy link

kvedantmahajan commented Oct 29, 2018

Found links #112 not working still. I believe it was fixed in 3.0.4.
I'm using this in my package.json

 "babel-plugin-transform-vue-jsx": "^3.7.0",

Is there possibility to do something of this sort directly

 <Button class="mr10">
          <icon name="page-previous-outline" />
        </Button>

        <Button>
          <icon name="page-next-outline" />
        </Button>

Then in my component


 return (
      <StyledBtn
        {...props}
        onClick={e => listeners.click(e)}
      >
        {title ? title : children}
      </StyledBtn>
    );

babel.config.js

module.exports = {
  presets: ["@vue/app"],
  plugins: ["transform-vue-jsx"]
};
@kvedantmahajan
Copy link
Author

@nickmessing
Copy link
Member

Spread is a little special so you have to do <tag {...{props}} /> because our VDom structure is not like React's, you can read more here

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