d576c08e7ebd74d45f832f8a6b447d7ffaaab9f7
website-products
官网产品页面的代码
目前都使用 coze 生成页面,但是 coze 的代码几乎都是 react 的,目前只有 react app 的操作事项
文件说明
基本配置
/react-product-loader
- 用于在 wordpress 中引入 react 页面的 pluigin
- 因为使用 coze 生成的代码几乎都是 react 的
- 放置在 plugin 文件夹下
wp-content/plugin/react-product-loader
page-react-template.php
- 用于展示产品的模板页面,不使用官网默认的模板
- 放置在当前使用的模板下面:
wp-content/themes/skyline-wp
产品页面
- 产品的页面放在
wp-content/products/react-apps下 - 在
固定ページ中创建页面,使用ショートコード引入[react_app app_name="alisurvey"]- 其中
app_name是文件夹的名字
开发事项
修改 baseUrl
参考这个 commit:
98dac11ece
main.tsx
createRoot(document.getElementById("root")!).render( # <---- 检查必须是 #root
<StrictMode>
- <BrowserRouter>
+ <BrowserRouter basename={import.meta.env.BASE_URL}>
<App />
<Toaster />
</BrowserRouter>
vite.config.ts
export default defineConfig({
plugins: getPlugins()
+ base: '/alisurvey', # <---- 需要和项目文件夹名一致
});
Description
Languages
TypeScript
87.6%
PHP
7.8%
HTML
3.2%
JavaScript
0.8%
CSS
0.6%