diff --git a/packages/vantui-cli/site/docs/components/pageLayout/index.js b/packages/vantui-cli/site/docs/components/pageLayout/index.js index b0335295d..105c82f5c 100644 --- a/packages/vantui-cli/site/docs/components/pageLayout/index.js +++ b/packages/vantui-cli/site/docs/components/pageLayout/index.js @@ -120,22 +120,15 @@ function getMobileUrl() { const routers = __vantui_base__?.routers || [] const current = window.location.hash.replace('#/', '') - let isHideSimulator = false - let defaultUrl = '' - + let useDashboard = false for (let i = 0; i < routers.length; i++) { const item = routers[i] - if (item.isHideSimulator && item.path === current) { - isHideSimulator = true - } - if (!defaultUrl && !item.isHideSimulator) { - defaultUrl = item.path + if (typeof item.hideSimulator === 'boolean' && item.path === current) { + useDashboard = true } } - console.info(domain) - - return isHideSimulator - ? `${domain}#/pages/${defaultUrl}/index` + return useDashboard + ? `${domain}#/pages/dashboard/index` : `${domain}#/pages/${current}/index` } diff --git a/packages/vantui-demo/config/index.js b/packages/vantui-demo/config/index.js index d77be1524..327995237 100644 --- a/packages/vantui-demo/config/index.js +++ b/packages/vantui-demo/config/index.js @@ -149,7 +149,7 @@ const config = { devServer: { port: 10086, hot: true, - host: '0.0.0.0', + host: 'localhost', historyApiFallback: true, headers: { 'Access-Control-Allow-Origin': '*', // 表示允许跨域 diff --git a/packages/vantui-doc/src/grid/README.md b/packages/vantui-doc/src/grid/README.md index 4fc9b5d95..3e2bf231c 100644 --- a/packages/vantui-doc/src/grid/README.md +++ b/packages/vantui-doc/src/grid/README.md @@ -56,7 +56,7 @@ function Demo() { return ( {[1, 2, 3].map((item, index) => ( - + - {icons.basic.map((name) => ( - + {icons.basic.map((name, i) => ( + {name} @@ -151,8 +155,9 @@ import icons from '@vant/icons' function Demo() { return ( <> - {icons.outline.map((name) => ( + {icons.outline.map((name, i) => ( @@ -172,8 +177,9 @@ import icons from '@vant/icons' function Demo() { return ( <> - {icons.filled.map((name) => ( + {icons.filled.map((name, i) => ( diff --git a/packages/vantui/src/grid-item/index.tsx b/packages/vantui/src/grid-item/index.tsx index b75054b76..74a8c45c4 100644 --- a/packages/vantui/src/grid-item/index.tsx +++ b/packages/vantui/src/grid-item/index.tsx @@ -43,10 +43,14 @@ export function GridItem( [index, setChildrenInstance], ) - useEffect(function () { - updateStyle() + useEffect( + function () { + updateStyle() + // eslint-disable-next-line react-hooks/exhaustive-deps + }, // eslint-disable-next-line react-hooks/exhaustive-deps - }, []) + [parentInstance.columnNum], + ) const updateStyle = useCallback( function () { diff --git a/packages/vantui/src/grid/index.tsx b/packages/vantui/src/grid/index.tsx index a8e77b286..9dc551ed2 100644 --- a/packages/vantui/src/grid/index.tsx +++ b/packages/vantui/src/grid/index.tsx @@ -71,7 +71,7 @@ export function Grid(props: GridProps) { return res }, // eslint-disable-next-line react-hooks/exhaustive-deps - [others.children], + [others.children, columnNum], ) return (