docs: update README with project structure, dependencies, image handling, and node version requirements

develop
时启龙 2024-12-02 15:18:49 +08:00
parent 4176805099
commit e40b6fc7aa
2 changed files with 39 additions and 9 deletions

View File

@ -1,16 +1,43 @@
# Vue 3 + TypeScript + Vite
## 项目结构
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
- main-web 主应用
- 提供登录页面/子应用入口
- cmc-web 管理端
- webs 子应用
- packages 本地包
- dll 动态链接库, 没用到
## Recommended IDE Setup
## 依赖项
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
- @cmp/cmp-api: cmc-web/packages/api 本地代码
- @cmp/cmp-common: cmc-web/packages/common 本地代码
- @cmp/\*\*\*: npm 包
## 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 enable Volar's Take Over mode by following these steps:
- 指向服务器 nginx: /web-common-resource
1. Run `Extensions: Show Built-in Extensions` from VS Code's command palette, look for `TypeScript and JavaScript Language Features`, then right click and select `Disable (Workspace)`. By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.
## vite 启动/打包项目有问题的话就不用
You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).
## 产物处理
本地 main-web/cmc-web ----------------------> 服务器 /opt/cmp/consoles/cmc-web **不要覆盖,因为里面还有其他文件**
本地 main-web/cmc-web/cof-web --------------> 服务器 /opt/cmp/consoles/cof-web
本地 cmc-web/webs/xxx-web/xxx-web ----------> 服务器 /opt/cmp/consoles/cmc-web/sub-app/xxx-web
# node 版本
node 16.x 其他版本依赖可能会有问题
# 下载依赖
pnpm install
# 开发环境启动
pnpm serve
# 生产环境构建
pnpm build

3
src/components.d.ts vendored
View File

@ -8,6 +8,7 @@ export {}
declare module '@vue/runtime-core' {
export interface GlobalComponents {
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
@ -36,11 +37,13 @@ declare module '@vue/runtime-core' {
ElTooltip: typeof import('element-plus/es')['ElTooltip']
Empty: typeof import('./components/empty/Empty.vue')['default']
IconEpArrowDown: typeof import('~icons/ep/arrow-down')['default']
IconEpArrowLeft: typeof import('~icons/ep/arrow-left')['default']
IconEpArrowRight: typeof import('~icons/ep/arrow-right')['default']
IconEpBell: typeof import('~icons/ep/bell')['default']
IconEpHomeFilled: typeof import('~icons/ep/home-filled')['default']
IconEpKey: typeof import('~icons/ep/key')['default']
IconEpLock: typeof import('~icons/ep/lock')['default']
IconEpRight: typeof import('~icons/ep/right')['default']
IconEpSearch: typeof import('~icons/ep/search')['default']
IconEpSwitchButton: typeof import('~icons/ep/switch-button')['default']
IconEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']