Vite @ alias path All In One
2022/4/21 6:19:27
本文主要是介绍Vite @ alias path All In One,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
Vite @ alias path All In One
error
@
alias path
solution
// vite.config.js import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' const path = require('path') // https://vitejs.dev/config/ export default defineConfig({ resolve:{ alias:{ '@' : path.resolve(__dirname, './src') }, }, plugins: [vue()] })
https://vueschool.io/articles/vuejs-tutorials/import-aliases-in-vite/
https://stackoverflow.com/questions/66043612/vue3-vite-project-alias-src-to-not-working
https://vitejs.dev/config/#resolve-alias
demo
<template> <!-- <>react fragment</> --> <!-- <template>vue fragment</template> --> <template v-if="true"> <div>{{store.msg}}</div> </template> <template v-if="true"> <div>{{store.getMsg}}</div> <!-- <pre>{{jsonString}}</pre> --> <pre>❓ {{store.msg}}</pre> <span v-pre>{{ this will not be compiled }}❓ {{store.msg}}</span> <button @click="updateMsg">Pinia
这篇关于Vite @ alias path All In One的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-26Mybatis官方生成器资料详解与应用教程
- 2024-11-26Mybatis一级缓存资料详解与实战教程
- 2024-11-26Mybatis一级缓存资料详解:新手快速入门
- 2024-11-26SpringBoot3+JDK17搭建后端资料详尽教程
- 2024-11-26Springboot单体架构搭建资料:新手入门教程
- 2024-11-26Springboot单体架构搭建资料详解与实战教程
- 2024-11-26Springboot框架资料:新手入门教程
- 2024-11-26Springboot企业级开发资料入门教程
- 2024-11-26SpringBoot企业级开发资料详解与实战教程
- 2024-11-26Springboot微服务资料:新手入门全攻略