update readme
This commit is contained in:
33
README.md
33
README.md
@@ -2,8 +2,12 @@
|
|||||||
|
|
||||||
官网产品页面的代码(目前尚未实际使用,仅仅用于留档)
|
官网产品页面的代码(目前尚未实际使用,仅仅用于留档)
|
||||||
|
|
||||||
|
> 目前都使用 coze 生成页面,但是 coze 的代码几乎都是 react 的,目前只有 react app 的操作事项
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# 文件说明
|
||||||
|
|
||||||
## 基本配置
|
## 基本配置
|
||||||
|
|
||||||
`react-product-loader`
|
`react-product-loader`
|
||||||
@@ -22,4 +26,31 @@
|
|||||||
- 产品的页面放在 `wp-content/products/react-apps` 下
|
- 产品的页面放在 `wp-content/products/react-apps` 下
|
||||||
- 在 `固定ページ` 中创建页面,使用 `ショートコード` 引入
|
- 在 `固定ページ` 中创建页面,使用 `ショートコード` 引入
|
||||||
- `[react_app app_name="alisurvey"]`
|
- `[react_app app_name="alisurvey"]`
|
||||||
- 其中 `app_name` 是文件夹的名字
|
- 其中 `app_name` 是文件夹的名字
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# 开发事项
|
||||||
|
|
||||||
|
## 修改 baseUrl
|
||||||
|
|
||||||
|
参考这个 commit: https://git.alicorns.co.jp/xuejiahao/website-products/commit/98dac11ece9c262b24376a3ff1227731b0ff96fd
|
||||||
|
|
||||||
|
1. `main.tsx`
|
||||||
|
```dff
|
||||||
|
createRoot(document.getElementById("root")!).render( # <---- 检查必须是 #root
|
||||||
|
<StrictMode>
|
||||||
|
- <BrowserRouter>
|
||||||
|
+ <BrowserRouter basename={import.meta.env.BASE_URL}>
|
||||||
|
<App />
|
||||||
|
<Toaster />
|
||||||
|
</BrowserRouter>
|
||||||
|
```
|
||||||
|
|
||||||
|
2. `vite.config.ts`
|
||||||
|
```dff
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: getPlugins()
|
||||||
|
+ base: '/alisurvey', # <---- 需要和项目文件夹名一致
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user