duyufeng
94e5079222
|
3 months ago | |
---|---|---|
build | 6 months ago | |
hx-ai-intelligent | 3 months ago | |
hx-op | 4 months ago | |
lib | 3 months ago | |
public | 6 months ago | |
src | 6 months ago | |
type | 6 months ago | |
.editorconfig | 6 months ago | |
.env | 6 months ago | |
.env.development | 6 months ago | |
.env.production | 6 months ago | |
.eslintignore | 6 months ago | |
.eslintrc.js | 6 months ago | |
.gitignore | 6 months ago | |
.prettierignore | 6 months ago | |
.stylelintignore | 6 months ago | |
LICENSE | 6 months ago | |
README.md | 3 months ago | |
gulpfile.js | 6 months ago | |
index.html | 6 months ago | |
main.i18n.json | 6 months ago | |
package.json | 3 months ago | |
pnpm-lock.yaml | 6 months ago | |
prettier.config.js | 6 months ago | |
stylelint.config.js | 6 months ago | |
tsconfig.json | 6 months ago | |
vite.config.ts | 6 months ago |
README.md
Vue 3 + Typescript + Vite
This template should help get you started developing with Vue 3 and Typescript in Vite.
Recommended IDE Setup
VSCode + Vetur. Make sure to enable vetur.experimental.templateInterpolationService
in settings!
If Using <script setup>
<script setup>
is a feature that is currently in RFC stage. To get proper IDE support for the syntax, use Volar instead of Vetur (and disable Vetur).
Type Support For .vue
Imports in TS
Since TypeScript cannot handle type information for .vue
imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in .vue
imports (for example to get props validation when using manual h(...)
calls), you can use the following:
If Using Volar
Run Volar: Switch TS Plugin on/off
from VSCode command palette.
If Using Vetur
- Install and add
@vuedx/typescript-plugin-vue
to the plugins section intsconfig.json
- Delete
src/shims-vue.d.ts
as it is no longer needed to provide module info to Typescript - Open
src/main.ts
in VSCode - Open the VSCode command palette
- Search and run "Select TypeScript version" -> "Use workspace version" test
目录结构
|-- build 构建相关
|-- hx-ai-intelligent AI智能BSA系统
|-- mock 定义模拟数据(登录/登出/获取用户信息等)
|-- public 静态资源
|-- resources 资源文件
|-- src
|-- api 定义接口请求地址
|-- components 当前项目的公共组件
|-- ns-modal-form.vue 经过二次封装后的“弹窗”通用组件
|-- ns-steps.vue 经过二次封装后的“步骤条”通用组件
|-- config 配置文件
|-- app.config.ts(包含应用程序配置的对象,包含api路径/组件配置等)
|-- directives 自定义指令(在vue应用程序中设置全局指令)
|-- enum 枚举(用于http请求配置和错误代码的处理)
|-- icon 图标(svg图标文件)
|-- router 路由
|-- store 状态管理
|-- theme 主题样式(less/scss)文件
|-- util 工具类
|-- debounce.ts 防抖函数(用于优化频繁出发的事件处理函数,例如窗口大小改变/滚动事件等)
|-- view 页面
|-- App.vue 根组件
|-- .env.development 当前项目开发环境配置
|-- .env.production 当前项目生产环境配置
|-- index.html 当前项目入口页
|-- tsconfig.json typescript配置
|-- vite.config.ts vite配置(包含当前项目请求接口地址)
|-- lib
|-- component 公共组件(color/drawer/echarts/flowChart/form/modal/table/tree等组件的二次封装或将组件注册为插件形式使用)
|-- paas 私有组件
|-- saas 私有组件
|-- type 类型定义
|-- use 自定义hook文件
|-- util (http/axios等工具类)
|-- node_modules 依赖包
|-- public 静态资源(不会被编译)
|-- src
|-- main.ts 入口文件(初始化saasInit函数的相关配置或服务的入口点。)
|-- type 声明定义应用程序的全局类型
|-- .env.development 开发环境配置
|-- .env.production 生产环境配置
|-- index.html 项目入口文件
|-- package.json 项目依赖包管理
|-- tsconfig.json typescript配置
|-- vite.config.ts vite配置
|-- README.md 项目说明