1. import path from "path";
    2. import vue from "@vitejs/plugin-vue";
    3. export default {
    4. resolve: {
    5. alias: {
    6. "@": path.resolve(__dirname, "src"),
    7. comps: path.resolve(__dirname, "src/components")
    8. },
    9. },
    10. plugins: [vue()],
    11. };
    1. //使用
    2. <template>
    3. <img alt="Vue logo" src="@/assets/logo.png" />
    4. </template>
    5. <script setup></script>
    6. <style></style>