Compare commits
3 Commits
home3.0
...
feature/ta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aca6703075 | ||
|
|
b09ca714a6 | ||
|
|
8c207774cc |
18
AGENTS.md
18
AGENTS.md
@@ -8,12 +8,26 @@ YGChatCS 是一个基于 uni-app + Vue 3 的多端应用,当前配置重点面
|
|||||||
|
|
||||||
## 技术栈
|
## 技术栈
|
||||||
|
|
||||||
- 框架:uni-app 3、Vue 3、Vite 5。
|
- 框架:uni-app 3、Vue 3、Vite 5、Tailwindcss。
|
||||||
- 状态管理:Pinia 3,使用 `pinia-plugin-unistorage` 做持久化。
|
- 状态管理:Pinia 3,使用 `pinia-plugin-unistorage` 做持久化。
|
||||||
|
- 图标:uni-icons、自定义图标znicons
|
||||||
- 样式:SCSS,公共工具类在 `src/static/scss/`,全局变量在 `src/uni.scss`。
|
- 样式:SCSS,公共工具类在 `src/static/scss/`,全局变量在 `src/uni.scss`。
|
||||||
- 多端:保留 H5、App、各类小程序脚本;当前微信小程序配置最完整。
|
- 多端:保留 H5、App、各类小程序脚本;当前微信小程序配置最完整。
|
||||||
- 组件生态:`src/uni_modules/` 中包含 DCloud 插件和第三方插件,如 `uni-popup`、`uni-icons`、`z-paging`、`zero-markdown-view`。
|
- 组件生态:`src/uni_modules/` 中包含 DCloud 插件和第三方插件,如 `uni-popup`、`uni-icons`、`z-paging`、`zero-markdown-view`。
|
||||||
|
|
||||||
|
## 自定义图标使用方式
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<uni-icons fontFamily="znicons" size="24" color="#6A717F">
|
||||||
|
{{ zniconsMap["zn-camera"] }}
|
||||||
|
</uni-icons>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { zniconsMap } from "@/static/fonts/znicons.js";
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
## 常用命令
|
## 常用命令
|
||||||
|
|
||||||
包管理器字段声明为 Yarn 1:
|
包管理器字段声明为 Yarn 1:
|
||||||
@@ -22,8 +36,6 @@ YGChatCS 是一个基于 uni-app + Vue 3 的多端应用,当前配置重点面
|
|||||||
yarn install
|
yarn install
|
||||||
yarn dev:mp-weixin
|
yarn dev:mp-weixin
|
||||||
yarn build:mp-weixin
|
yarn build:mp-weixin
|
||||||
yarn dev:h5
|
|
||||||
yarn build:h5
|
|
||||||
yarn switch-client zhinian
|
yarn switch-client zhinian
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"name": "YGChatCS",
|
"name": "YGChatCS",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"postinstall": "node ./node_modules/weapp-tailwindcss/bin/weapp-tailwindcss.js patch",
|
||||||
"dev:app": "uni -p app",
|
"dev:app": "uni -p app",
|
||||||
"dev:app-android": "uni -p app-android",
|
"dev:app-android": "uni -p app-android",
|
||||||
"dev:app-ios": "uni -p app-ios",
|
"dev:app-ios": "uni -p app-ios",
|
||||||
@@ -70,10 +71,13 @@
|
|||||||
"@dcloudio/uni-cli-shared": "3.0.0-4070620250821001",
|
"@dcloudio/uni-cli-shared": "3.0.0-4070620250821001",
|
||||||
"@dcloudio/uni-stacktracey": "3.0.0-4070620250821001",
|
"@dcloudio/uni-stacktracey": "3.0.0-4070620250821001",
|
||||||
"@dcloudio/vite-plugin-uni": "3.0.0-4070620250821001",
|
"@dcloudio/vite-plugin-uni": "3.0.0-4070620250821001",
|
||||||
|
"@tailwindcss/postcss": "^4.3.0",
|
||||||
"@vue/runtime-core": "^3.4.21",
|
"@vue/runtime-core": "^3.4.21",
|
||||||
"@vue/tsconfig": "^0.1.3",
|
"@vue/tsconfig": "^0.1.3",
|
||||||
"sass": "1.58.3",
|
"sass": "1.58.3",
|
||||||
"vite": "5.2.8"
|
"tailwindcss": "^4.3.0",
|
||||||
|
"vite": "5.2.8",
|
||||||
|
"weapp-tailwindcss": "^4.12.0"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||||
}
|
}
|
||||||
|
|||||||
7
src/app.css
Normal file
7
src/app.css
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
@import "weapp-tailwindcss/index.css";
|
||||||
|
|
||||||
|
@source "./**/*.{vue,js,ts}";
|
||||||
|
@source not "./uni_modules";
|
||||||
|
@source not "../dist";
|
||||||
|
@source not "../node_modules";
|
||||||
|
@source not "../docs";
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import App from "./App";
|
import App from "./App";
|
||||||
|
import "./app.css";
|
||||||
import share from "./utils/share";
|
import share from "./utils/share";
|
||||||
|
|
||||||
// #ifndef VUE3
|
// #ifndef VUE3
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<scroll-view class="test-page h-screen bg-F5F7FA" scroll-y>
|
<scroll-view class="test-page h-screen bg-F5F7FA" scroll-y>
|
||||||
<view class="test-page__header">
|
<view class="test-page__header">
|
||||||
<view class="test-page__title">ChatModule 视觉组件预览</view>
|
<view class="text-[20px] text-red-500 font-bold">ChatModule 视觉组件预览</view>
|
||||||
<view class="test-page__subtitle">组件使用 props mock 数据渲染,点击事件仅打印日志。</view>
|
<view class="mt-2 text-[#64748b] font-bold text-[12px] leading-5">组件使用 props mock 数据渲染,点击事件仅打印日志。</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="test-page__section">
|
<view class="test-page__section">
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import { defineConfig } from "vite";
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
import uni from "@dcloudio/vite-plugin-uni";
|
import uni from "@dcloudio/vite-plugin-uni";
|
||||||
import md5 from "md5-hash";
|
import md5 from "md5-hash";
|
||||||
|
import tailwindcss from "@tailwindcss/postcss";
|
||||||
|
import { UnifiedViteWeappTailwindcssPlugin } from "weapp-tailwindcss/vite";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
@@ -11,6 +13,9 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
css: {
|
css: {
|
||||||
|
postcss: {
|
||||||
|
plugins: [tailwindcss()],
|
||||||
|
},
|
||||||
preprocessorOptions: {
|
preprocessorOptions: {
|
||||||
scss: {
|
scss: {
|
||||||
api: "modern-compiler",
|
api: "modern-compiler",
|
||||||
@@ -18,7 +23,13 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [uni()],
|
plugins: [
|
||||||
|
uni(),
|
||||||
|
UnifiedViteWeappTailwindcssPlugin({
|
||||||
|
rem2rpx: true,
|
||||||
|
cssEntries: [path.resolve(__dirname, "./src/app.css")],
|
||||||
|
}),
|
||||||
|
],
|
||||||
build: {
|
build: {
|
||||||
commonjsOptions: {
|
commonjsOptions: {
|
||||||
transformMixedEsModules: true,
|
transformMixedEsModules: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user