how can i rewrite a built-in directive like v-model? #6337
Unanswered
gguoyu
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, Every One
I have a custom render that not web. so i need to rewrite some built-in directive. eg. v-show, v-model.
But I read the source code of @vue/compiler-core & @vue/compiler-dom. also include @vue/runtime-dom. I found that if we used v-show in our template. when we compiled. the v-show helpers will convert v-show to some other string. and the v-show directive code defined in @vue/runtime-dom will insert to the final bundle.
I try to write code like @vue/compiler-dom/src/transforms/vMode.ts, and pass to the compiler option:
compilerOptions: { directiveTransforms: { model: transformModel, }, },
But it not works. because the vModel directive i've written has no place to pass in.
So. How can i do it...
thx all...
Beta Was this translation helpful? Give feedback.
All reactions