Skip to content

Commit 537c52f

Browse files
author
李磊
committed
fix: 函数式弹窗全局弹窗
1 parent b02575c commit 537c52f

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

packages/ui/src/components/ConfigProvider/style/expandComponents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const expandComponentsStyle = (prefix: string) => {
2828
cursor: 'move',
2929
userSelect: 'none',
3030
}),
31-
c('.l-modal-title', {
31+
c('.l-modal-title-no-drag', {
3232
height: '100%',
3333
display: 'flex',
3434
alignItems: 'center',

packages/ui/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
LModalForm,
1010
installUseModal,
1111
LSignature,
12+
type HookModalProps,
1213
} from './components';
1314

1415
export { version } from './version';
@@ -24,13 +25,12 @@ const components = [
2425
LSignature,
2526
];
2627

27-
function install(app: App) {
28+
function install(app: App, options?: HookModalProps) {
2829
components.forEach((component) => {
2930
app.use(component);
3031
});
3132
installUseModal(app, {
32-
clsPrefix: 'ant',
33-
drag: true,
33+
...options,
3434
});
3535
}
3636

playground/src/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import router from './router';
66
import Antd from 'ant-design-vue';
77
import 'ant-design-vue/dist/reset.css';
88
// 引入@ssuperlilei/ui
9-
import ll_libUI from '@ssuperlilei/ui';
9+
import ll_libUI from '~@ssuperlilei/ui';
1010
import '@ssuperlilei/ui/style.css';
1111
// import { globalRegister } from '@ssuperlilei/directives';
1212

1313
const app = createApp(App);
1414
app.use(Antd); // 全局引入antdv组件
15-
app.use(ll_libUI); // 全局引入@ssuperlilei/ui组件
15+
app.use(ll_libUI, {
16+
drag: false,
17+
}); // 全局引入@ssuperlilei/ui组件
1618
// globalRegister(app); // 全局引入@ssuperlilei/directives指令
1719
app.use(router);
1820
app.mount('#app');

playground/src/views/Ui/ModalForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const openHooksModal = () => {
6363
ModalRender.show({
6464
title: '我是hook纯函数式模态框',
6565
content: 'hello',
66-
drag: true,
66+
// drag: true,
6767
formProps,
6868
wrapClassName: 'modalSizeMedium',
6969
submit,

0 commit comments

Comments
 (0)