Compare commits

...

2 Commits

Author SHA1 Message Date
hsueh chiahao
98dac11ece fix path 2025-09-25 17:40:35 +08:00
hsueh chiahao
b091693221 remove css 2025-09-25 17:40:16 +08:00
4 changed files with 33 additions and 3 deletions

View File

@@ -22,4 +22,4 @@ npm install
npm run dev
```
- 在浏览器访问 http://localhost:3000
- 在浏览器访问 http://localhost:3000/alisurvey

View File

@@ -7,7 +7,7 @@ import "./index.css";
createRoot(document.getElementById("root")!).render(
<StrictMode>
<BrowserRouter>
<BrowserRouter basename={import.meta.env.BASE_URL}>
<App />
<Toaster />
</BrowserRouter>

View File

@@ -12,5 +12,6 @@ function getPlugins() {
}
export default defineConfig({
plugins: getPlugins()
plugins: getPlugins(),
base: '/alisurvey',
});

View File

@@ -87,4 +87,33 @@ function rpl_enqueue_react_app_assets() {
'6.7.2'
);
}
}
/**
* 使用黑名单模式,在 React 模板页面移除指定样式
*/
add_action( 'wp_enqueue_scripts', 'rpl_blacklist_specific_styles', 99 );
function rpl_blacklist_specific_styles() {
// 仅在 page-react-template.php 模板上执行
if ( ! is_page_template( 'page-react-template.php' ) ) {
return;
}
// --- 定义要移除的样式句柄handle黑名单 ---
$blacklisted_handles = [
// colibri-page-builder
'fancybox',
'extend-builder-css',
'extend_builder_-fonts',
];
// 遍历黑名单并移除每个样式
foreach ( $blacklisted_handles as $handle ) {
wp_dequeue_style( $handle );
}
// global $wp_styles;
// echo '<pre id="test">';
// print_r( $wp_styles->queue );
// echo '</pre>';
}