-
-
Notifications
You must be signed in to change notification settings - Fork 377
feat: support directives #179
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
Conversation
Thanks for the hard work! However, I don't really want to introduce Babel here, giving the fact that for components it's quite straightforward to search for |
Yes. But in Vue 2, it will be very hard to transform without AST. var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("test-comp", {
directives: [
{ name: "loading", rawName: "v-loading", value: 123, expression: "123" }
]
})
} |
But honestly, do we really need this? I found directives are rarely used for me. For the few of them, I think it's better to register globally - I don't expect directives to be huge that impacting the code-splitting. |
IMO, It can be used out of the box in some ui frameworks (element-plus, element-ui), if with this feature. |
I am fine to have this but I don't want to introduce Babel that affecting the existing users just because of a relatively rarely used feature. If you absolutely need this, I think we should keep the original transformation, and have babel enabled only for Vue 2 directives with an explicit flag to enable (default to false). |
OK. I will change it. |
@antfu Done. |
9106b0e
to
ecbaa3d
Compare
@antfu I fixed unit test. Feel free to tell me if you have any questions. |
Hi, when can it gets merged? |
close #155