Skip to content

fix(modal & button): dLoading 需要单独引入 & 默认点击背景可以 modal 关闭 #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/devui-vue/devui/button/src/button.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { computed, defineComponent, ref } from 'vue';
import { Icon } from '../../icon';
import loadingDirective from '../../loading/src/directive';
import { buttonProps } from './button-types';

import './button.scss';

export default defineComponent({
name: 'DButton',
directives: {
devLoading: loadingDirective
},
props: buttonProps,
setup(props, ctx) {
const buttonContent = ref<HTMLSpanElement | null>(null);
Expand Down Expand Up @@ -49,13 +53,17 @@ export default defineComponent({
width
} = props;
return (
<div class="devui-btn-host" {...ctx.attrs} v-dLoading={showLoading}>
<div
class="devui-btn-host"
{...ctx.attrs}
>
<button
class={btnClass.value}
type={type}
disabled={disabled}
style={{ width }}
onClick={onClick}
v-devLoading={showLoading}
>
{!!icon ? (
<Icon name={icon} class={iconClass.value} />
Expand Down
2 changes: 1 addition & 1 deletion packages/devui-vue/devui/modal/src/dialog-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const dialogProps = {
},
backdropCloseable: {
type: Boolean,
default: false
default: true
},
bodyScrollable: {
type: Boolean,
Expand Down
4 changes: 2 additions & 2 deletions packages/devui-vue/devui/modal/src/modal-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const modalProps = {
},
backdropCloseable: {
type: Boolean,
default: false
default: true
},
bodyScrollable: {
type: Boolean,
Expand All @@ -58,7 +58,7 @@ export const modalProps = {
type: Function as PropType<() => void>,
},
beforeHidden: {
type: [Object, Function] as PropType<Promise<boolean> | (() => boolean| Promise<boolean>)>
type: [Object, Function] as PropType<Promise<boolean> | (() => boolean | Promise<boolean>)>
},

modelValue: {
Expand Down
1 change: 0 additions & 1 deletion packages/devui-vue/devui/modal/src/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
computed,
defineComponent,
Transition,
watch
} from 'vue'
import { modalProps, ModalProps } from './modal-types'
import { FixedOverlay } from '../../overlay'
Expand Down