-
Notifications
You must be signed in to change notification settings - Fork 96
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
feat: add @vue/composition-api support #142
Conversation
bc01af5
to
c678dd1
Compare
Co-authored-by: luwanquan <1501474302@qq.com>
Co-authored-by: luwanquan <1501474302@qq.com>
5036d52
to
eda1741
Compare
packages/babel-sugar-composition-api-render-instance/src/index.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Haoqun Jiang <haoqunjiang@gmail.com>
Sorry for the delay. Updated. |
The example in the README of |
Updated. |
Thanks! |
Released as v1.2.1 |
With this PR, I'm getting this error on the browser console:
|
Any reproductions? |
Reproduction: https://github.com/jvbianchi/error-jsx |
Got it. The |
Great. Can I delete the test repo? |
Yeah. Feel free to. Thanks for the report! |
@antfu The issue here is that in the Here we need an approach that works like the classic With export default {
render() {
return h("div", [h("input", {
"on": {
"input": ($event) => {
if ($event.target.composing) return;
this.$set(a, "value", $event.target.value);
}
},
}])
}
} turns into export default {
render() {
var _this = this
return h("div", [h("input", {
"on": {
"input": function input($event) {
if ($event.target.composing) return;
_this.$set(a, "value", $event.target.value);
}
},
}])
}
} Similarly, with export default {
render() {
var _this = getCurrentInstance()
return h("div", [h("input", {
"on": {
"input": function input($event) {
if ($event.target.composing) return;
_this.$set(a, "value", $event.target.value);
}
},
}])
}
} (Implementation of the |
Thanks to @luwanquan who made the jsx plugin https://github.com/luwanquan/babel-preset-vca-jsx which is the base of these changes.
#76, This PR provides minimal support for @vue/composition-api.
h
from@vue/composition-api
this
in v-model/v-on usage togetCurrentInstance()
It is disabled by default. To use it, users need to set the config by: