From 43fc31026e44965a2b59c99c6a25d9ecd7d7dab6 Mon Sep 17 00:00:00 2001 From: Linzp Date: Mon, 18 May 2026 16:05:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=B1=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E6=B1=A1=E6=9F=93=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +-- src/components/Global/index.js | 21 +++++++----- src/components/Global/override.scss | 43 ----------------------- src/components/Global/style.module.scss | 45 ++++++++++++++++++++++++- 4 files changed, 59 insertions(+), 54 deletions(-) delete mode 100644 src/components/Global/override.scss diff --git a/package.json b/package.json index ae24e9d..1af3c35 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,9 @@ "@kne/create-deferred": "^0.1.0", "@kne/ensure-slash": "^0.1.0", "@kne/flex-box": "^0.1.1", - "@kne/form-info": "^0.1.7", + "@kne/form-info": "^0.1.9", "@kne/global-context": "^1.3.2", - "@kne/info-page": "^0.2.9", + "@kne/info-page": "^0.2.10", "@kne/is-empty": "^1.0.1", "@kne/phone-number-input": "^0.1.5", "@kne/react-enum": "^0.1.14", diff --git a/src/components/Global/index.js b/src/components/Global/index.js index 4cbd1fd..bbfc679 100644 --- a/src/components/Global/index.js +++ b/src/components/Global/index.js @@ -1,6 +1,5 @@ import "./polyfill"; import "simplebar/dist/simplebar.min.css"; -import "./override.scss"; import classnames from "classnames"; import { Global as GlobalContext, useGlobalContext as useContext, usePreset, GlobalValue, useGlobalValue, GlobalSetting @@ -24,13 +23,19 @@ import Color from "color"; import {createWithRemoteLoader} from "@kne/remote-loader"; import isEqual from './isEqual'; -document.body.classList.add(style["container"]); -if (!isMobile() && !window.__COMPONENTS_CORE_SIMPLE_BAR_DISABLED) { - new SimpleBar(document.body); - getScrollEl().classList.add(style["container"]); -} else { - document.body.classList.add("simplebar-content-wrapper"); -} +(() => { + if (window.__COMPONENTS_CORE_IN_SDK) { + return; + } + document.body.classList.add(style["container"]); + if (!isMobile() && !window.__COMPONENTS_CORE_SIMPLE_BAR_DISABLED) { + new SimpleBar(document.body); + getScrollEl().classList.add(style["container"]); + } else { + document.body.classList.add("simplebar-content-wrapper"); + } +})(); + export const containerClassName = style["container"] .replace(/\+/g, "\\+") diff --git a/src/components/Global/override.scss b/src/components/Global/override.scss deleted file mode 100644 index 18fc04b..0000000 --- a/src/components/Global/override.scss +++ /dev/null @@ -1,43 +0,0 @@ -html { - //overflow: hidden; -} - -body { - overflow: auto !important; - padding: 0; - margin: 0; - height: 100vh; - - &::-webkit-scrollbar { - width: 0; - height: 0; - } - - * { - -webkit-tap-highlight-color: transparent; - outline: none; - } -} - -.simplebar-scrollbar:before { - background: #666; -} - -.container-body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, - Helvetica Neue, Arial, Noto Sans, sans-serif, apple color emoji, - segoe ui emoji, Segoe UI Symbol, noto color emoji; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - box-sizing: border-box; - -webkit-tap-highlight-color: transparent; -} - -.ant-message { - z-index: 3010; -} - -.ant-picker-dropdown .ant-picker-month-panel .ant-picker-content { - height: 200px; -} diff --git a/src/components/Global/style.module.scss b/src/components/Global/style.module.scss index 0c856b1..abaae7f 100644 --- a/src/components/Global/style.module.scss +++ b/src/components/Global/style.module.scss @@ -1,7 +1,50 @@ @import "../../common/warning-color.scss"; +body.container { + overflow: auto !important; + padding: 0; + margin: 0; + height: 100vh; + + &::-webkit-scrollbar { + width: 0; + height: 0; + } + + * { + -webkit-tap-highlight-color: transparent; + outline: none; + } +} + .container { box-sizing: border-box; + + :global { + .simplebar-scrollbar:before { + background: #666; + } + + .container-body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, + Helvetica Neue, Arial, Noto Sans, sans-serif, apple color emoji, + segoe ui emoji, Segoe UI Symbol, noto color emoji; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + box-sizing: border-box; + -webkit-tap-highlight-color: transparent; + } + + .ant-message { + z-index: 3010; + } + + .ant-picker-dropdown .ant-picker-month-panel .ant-picker-content { + height: 200px; + } + } + &.is-not-init { pointer-events: none; opacity: 0.7; @@ -117,7 +160,7 @@ :global(.btn-text-link) { padding: 0; - border: none !important; + border-color: transparent !important; background: transparent; color: var(--primary-color); box-shadow: none !important;