Skip to content

Add special DOM props to JSX #89

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

Merged
merged 2 commits into from
Jul 25, 2017
Merged

Conversation

nickmessing
Copy link
Member

Atomatically bind special props like value to domProps just like vue-template.

@nickmessing nickmessing requested a review from yyx990803 July 21, 2017 01:00
test/test.js Outdated
))
expect(vnode.data.domProps.value).to.equal('value')
const vnode2 = render(h => (
<input value="value" type="button" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just occurs to me that a static value attribute should probably be treated as the initial value only and thus be transpiled into attrs. Is there a way to differentiate this with value={...}? Probably just checking if the node's bound value is a literal string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, will do that in a second

@nickmessing
Copy link
Member Author

@yyx990803, updated, should I add same behaviour for babel-helper-vue-jsx-merge-props?

@yyx990803
Copy link
Member

@nickmessing yes

@nickmessing
Copy link
Member Author

nickmessing commented Jul 22, 2017

@yyx990803, I don't see how we can use it there since we don't even support <a {...{onClick: this.fn}} />, it's just merging objects. Maybe we should consider runtime attrs parser similar to one included in here?

P.S. Looks like done here, can you please merge and release a new version on npm because nickmessing/babel-plugin-jsx-v-model#3 needs the underscore events.
P.P.S. It would be nice if you could take a look at tests

@yyx990803 yyx990803 merged commit 582b4a6 into vuejs:master Jul 25, 2017
@yyx990803
Copy link
Member

Released in 3.5.0

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

Successfully merging this pull request may close these issues.

2 participants