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

WIP: implement Weex native directive compiler for <recycle-list> #6622

Merged

Conversation

Hanks10100
Copy link
Contributor

@Hanks10100 Hanks10100 commented Sep 16, 2017

  • v-bind & :
  • v-if
  • v-else
  • v-else-if
  • v-for
  • v-on & @

@Hanks10100
Copy link
Contributor Author

In order to support the binding arguments of the inline event handler, I think the binding argument list should also pass to Weex runtime.

The expected compilation results are as follows.

1. Normal handler (no change).

<div @click="doSomething"></div>
on: {
  click: vm.doSomething
}

2. Inline handler.

<div @click="doSomething(index, 'xxx')"></div>
on: {
  click: {
    handler: function (index, 'xxx', $event) {
      vm.doSomething(index, 'xxx')
    },
    params: [{ '@binding': 'index' }, 'xxx']
  }
}

3. Inline handler with $event.

<div @click="doSomething(index, $event, 35)"></div>
on: {
  click: {
    handler: function (index, $event, 35) {
      vm.doSomething(index, $event, 35)
    },
    params: [{ '@binding': 'index' }, { '@binding': '$event' }, 35]
  },
}

The logic of binding events also needs to be modified. I have a try: dev...Hanks10100:weex-event

@yyx990803 yyx990803 merged commit 1e41d51 into vuejs:weex-native-directive Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants