vue3.3.4 Directive #8856
Unanswered
pythonliuwei-root
asked this question in
Help/Questions
Replies: 2 comments
-
my App.vue code is
change
<script setup lang="ts">
import { ref, reactive, Directive, DirectiveBinding } from "vue";
const flag = ref(false);
const vHasShow: Directive = (el, binding) => {
console.log(el.value, binding.value);
};
const list = ref([1, 2, 3]);
const change = () => {
list.value = [4, 5, 6];
};
</script>
<style scopred></style>
this is good! Directive in lang="ts" but I think vue3 docs show lang="ts" Directive is good.but lang="js" Directive is no good. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The in js.
the directive should be a function. but the vue not export the function is this your question ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Vue version
3.3.4
Link to minimal reproduction
/node_module/.vite/deps/vue.js?v=aa92c6f4
Steps to reproduce
my App.vue file code
<script setup> import {ref, reactive, directive} from 'vue' </script> <style scopred> </style>web page error message:
Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/vue.js?v=aa92c6f4' does not provide an export named 'Directive' (at App.vue:8:45)
What is expected?
I read vue docs Directive is say give coder use! but I use Directive create my Directive. but you know! yeah I get a error message
What is actually happening?
I see my web page error message:
Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/vue.js?v=aa92c6f4' does not provide an export named 'Directive' (at App.vue:8:45)
System Info
Any additional comments?
No response
Beta Was this translation helpful? Give feedback.
All reactions