Open yyq-bit opened 1 year ago
The auto-import directive is supported, but you are not using it correctly.
According to the example provided in the playground
, the correct usage should be like this:
<script setup lang="ts">
// import { ellipsis } from "./composables/ellipsis";
</script>
<script lang="ts">
export default {
directives: {
ellipsis: vEllipsis,
},
};
</script>
<template>
<div v-ellipsis class="wrap">
我是很长的一段话我是很长的一段话我是很长的一段话我是很长的一段话我是很长的一段话我是很长的一段话我是很长的一段话
</div>
</template>
<style scoped>
.wrap {
width: 200px;
}
</style>
You need
unplugin-vue-components also can resolve your problem
unplugin-vue-components also can resolve your problem
how??
Describe the bug
I defined an custom directives - vEllipsis
It works when import vEllipsis,auto import succeed,but it doesn't works.
Reproduction
https://stackblitz.com/edit/vitejs-vite-p9rpye?file=src%2FApp.vue,src%2Fauto-imports.d.ts,package.json&terminal=dev
System Info
Used Package Manager
npm
Validations