Closed pythonliuwei-root closed 1 year ago
my App.vue code is
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.
<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>
The Directive
is a type not a function
in js.
<script setup>
import {ref, reactive, directive} from 'vue'
</script>
the directive should be a function. but the vue not export the function
is this your question ?
Vue version
3.3.4
Link to minimal reproduction
/node_module/.vite/deps/vue.js?v=aa92c6f4
Steps to reproduce
my App.vue file codeweb 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