juechafun/20260207-备忘-TDesign-项目初始化.md

91 lines
1.9 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
#领域/TDesign
#复盘/0 #临时/备忘 #状态/待处理
## 一句话描述
[___tdesign项目初始化_____]
---
## 核心规范
>空想不如行动,积累胜于苛求。
>实践 > 沉淀 > 完美主义
实践不是盲目行动,而是带着“小目标、可验证“的方向试错,实践后必须沉淀(比如记录问题、总结规律),否则就是低水平重复。
实践大于沉淀,沉淀大于完美;完美是沉淀的终局方向,沉淀是实践的复盘产物;分域施策,避坑落地,始于行动,终于迭代。
---
## 三省沉淀法
- 达成了[___通过 tdesign cli 创建新的前端项目_____]目标
- 遇到了[__创建时全量或轻量都不会完全适配实际项目需求______]问题
- 下次改进[__创建全量作为可查询示例创建轻量作为实际项目框架______]
## 个人理解
[___丰富的前端组件示例组合实现页面_____]
## 实践计划
#状态/待实践
1. [__建立提问模板例如在页面中添加什么什么明确标注知识背景注意是否存在更新现有实现需要实现______]
2. [__基于此框架建立二次组合封装各种组件______]
3. [________]
---
## 核心定义
```bash
# 安装 CLI 工具
npm i tdesign-starter-cli@latest -g
# 创建项目
td-starter init
```
### 示例
#### ✅ 示例一:
```bash
```
#### ✅ 示例二:
```bash
```
### 避坑点
⚠️ 避坑点1
解决方案:
⚠️ 避坑点1在线开发环境域名出现非正常访问
核心问题对未知的host不允许
解决方案:✅ 修改 vite.config.ts 文件,设置 host 为 0.0.0.0
```js
export default defineConfig({
  plugins: [vue()],
  server: {
    port: 3002,
    host: '0.0.0.0',
    allowedHosts: ['.cnb.run'],
    proxy: {
      '/api': 'http://127.0.0.1:3000/',
    },
  }
})
```