我正在使用 ANT Design 中的复选框,这是复选框的默认大小。
现在,我想增加复选框的大小,因此我更改了宽度和高度,现在我的复选框如下所示:
如何更改刻度线的大小?这是我的CSS:
.ant-checkbox-checked .ant-checkbox-inner{
background-color: #008000;
width: 30px;
height: 30px;
}
Run Code Online (Sandbox Code Playgroud) 当我刷新页面时,它会重定向到主页,但在其他页面中,刷新会按预期进行。我实际上已添加trailingSlash: true到我的 next.config 但它仍然不起作用。
const redirectToLivePage = async () => {
const result = await dispatch(
getMeetingAction(meetingId, { shares_count: shares }),
);
if (result.ok) {
router.push(`/meetings/${meetingId}/shares_count=${shares}`);
}
};
Run Code Online (Sandbox Code Playgroud)
这是我的动态页面的代码。
const MeetingPage = () => {
useEffect(() => {
let interval;
if (data?.data.stream_status !== 'complete') {
interval = setInterval(() => {
dispatch(getMeetingAction(id, { shares_count: shares }));
}, 5000);
}
return () => {
clearInterval(interval);
};
}, [data]);
return (
<>
{data?.data?.stream_status === 'complete' ? (
<Player src={data?.data?.stream_hls_playlist …Run Code Online (Sandbox Code Playgroud) 我按照 antd 和 nextjs 文档来配置项目。
将此代码添加到./scripts/genAntdCss.tsx文件中:
import { extractStyle } from '@ant-design/static-style-extract';
import fs from 'fs';
const outputPath = './public/antd.min.css';
const css = extractStyle();
fs.writeFileSync(outputPath, css);
Run Code Online (Sandbox Code Playgroud)
这是 App.tsx 文件:
import { StyleProvider } from '@ant-design/cssinjs';
import type { AppProps } from 'next/app';
import '../public/antd.min.css';
export default function App({ Component, pageProps }: AppProps) {
return (
<StyleProvider hashPriority='high'>
<Component {...pageProps} />
</StyleProvider>
);
}
Run Code Online (Sandbox Code Playgroud)
这些命令添加到package.json文件中:
"predev": "ts-node --project ./tsconfig.node.json ./scripts/genAntdCss.tsx",
"prebuild": "ts-node --project ./tsconfig.node.json ./scripts/genAntdCss.tsx"
Run Code Online (Sandbox Code Playgroud)
你有什么想法来解决这个问题吗?
我有两个独立的组件。在组件 AI 中有一些链接,在组件 B 中有一个光滑的滑块。如何使用组件 A 中的 Links onClick 事件更改幻灯片。
我有一个 React 组件,它返回一个带有按钮的表单。当我单击按钮时,我希望在同一页面上显示另一个不同的表单。我怎么做?单击按钮时如何返回下一个表单?下面只是给出主要思想的一个例子
function Example() {
return (
<div>
<form>
<button onclick={showForm}></button>
</form>
</div>
)
}
Run Code Online (Sandbox Code Playgroud)