diff --git a/components/_util/ContainerRender.vue b/components/_util/ContainerRender.vue index d949112bc..19c0db2be 100644 --- a/components/_util/ContainerRender.vue +++ b/components/_util/ContainerRender.vue @@ -40,18 +40,25 @@ export default { } }, - renderComponent (props, ready) { + renderComponent (props = {}, ready) { const { visible, getComponent, forceRender, getContainer, parent } = this const self = this if (visible || parent.$refs._component || forceRender) { + let el = this.componentEl if (!this.container) { this.container = getContainer() + el = document.createElement('div') + this.componentEl = el + this.container.appendChild(el) } if (!this._component) { this._component = new Vue({ + data: { + comProps: props, + }, parent: self.parent, - el: self.container, + el: el, mounted () { this.$nextTick(() => { if (ready) { @@ -60,9 +67,11 @@ export default { }) }, render () { - return getComponent(props) + return getComponent(this.comProps) }, }) + } else { + this._component.comProps = props } } }, diff --git a/components/_util/props-util.js b/components/_util/props-util.js index ea74b6b4f..d4434250a 100644 --- a/components/_util/props-util.js +++ b/components/_util/props-util.js @@ -127,7 +127,11 @@ export function getStyle (ele) { } else if (ele.$vnode && ele.$vnode.data) { data = ele.$vnode.data } - return data.style || parseStyleText(data.staticStyle || '') + let style = data.style || data.staticStyle + if (typeof style === 'string') { + style = parseStyleText(style) + } + return style } export function getComponentName (opts) { diff --git a/components/alert/demo/banner.md b/components/alert/demo/banner.md new file mode 100644 index 000000000..da0d10833 --- /dev/null +++ b/components/alert/demo/banner.md @@ -0,0 +1,23 @@ + +#### 顶部公告 +页面顶部通告形式,默认有图标且`type` 为 'warning'。 + + + +#### Banner +Display Alert as a banner at top of page. + + +```html + +``` diff --git a/components/alert/demo/basic.md b/components/alert/demo/basic.md new file mode 100644 index 000000000..d3e81b4cf --- /dev/null +++ b/components/alert/demo/basic.md @@ -0,0 +1,15 @@ + +#### 基本 +最简单的用法,适用于简短的警告提示。 + + + +#### basic +The simplest usage for short messages. + + +```html + +``` diff --git a/components/alert/demo/closable.md b/components/alert/demo/closable.md new file mode 100644 index 000000000..d42ca2859 --- /dev/null +++ b/components/alert/demo/closable.md @@ -0,0 +1,38 @@ + +#### 可关闭的警告提示 +显示关闭按钮,点击可关闭警告提示。 + + + +#### Closable +To show close button. + + +```html + + +``` diff --git a/components/alert/demo/close-text.md b/components/alert/demo/close-text.md new file mode 100644 index 000000000..06516026e --- /dev/null +++ b/components/alert/demo/close-text.md @@ -0,0 +1,15 @@ + +#### 自定义关闭 +可以自定义关闭,自定义的文字会替换原先的关闭 `Icon`。 + + + +#### Customized Close Text +Replace the default icon with customized text. + + +```html + +``` diff --git a/components/alert/demo/description.md b/components/alert/demo/description.md new file mode 100644 index 000000000..8da625522 --- /dev/null +++ b/components/alert/demo/description.md @@ -0,0 +1,39 @@ + +#### 含有辅助性文字介绍 +含有辅助性文字介绍的警告提示。 + + + +#### Description +Additional description for alert message. + + +```html + +``` diff --git a/components/alert/demo/icon.md b/components/alert/demo/icon.md new file mode 100644 index 000000000..68f32c6e7 --- /dev/null +++ b/components/alert/demo/icon.md @@ -0,0 +1,44 @@ + +#### 图标 +可口的图标让信息类型更加醒目。 + + + +#### Icon +Decent icon make information more clear and more friendly. + + +```html + +``` diff --git a/components/alert/demo/index.vue b/components/alert/demo/index.vue new file mode 100644 index 000000000..038f85940 --- /dev/null +++ b/components/alert/demo/index.vue @@ -0,0 +1,55 @@ + + diff --git a/components/alert/demo/style.md b/components/alert/demo/style.md new file mode 100644 index 000000000..47a111bf3 --- /dev/null +++ b/components/alert/demo/style.md @@ -0,0 +1,20 @@ + +#### 四种样式 +共有四种样式 `success`、`info`、`warning`、`error`。 + + + +#### More types +There are 4 types of Alert: `success`, `info`, `warning`, `error`. + + +```html + +``` diff --git a/components/alert/index.en-US.md b/components/alert/index.en-US.md new file mode 100644 index 000000000..cbc01cf36 --- /dev/null +++ b/components/alert/index.en-US.md @@ -0,0 +1,18 @@ + +## API + +| Property | Description | Type | Default | +| -------- | ----------- | ---- | ------- | +| banner | Whether to show as banner | boolean | false | +| closable | Whether Alert can be closed | boolean | - | +| closeText | Close text to show | string\|slot | - | +| description | Additional content of Alert | string\|slot | - | +| message | Content of Alert | string\|slot | - | +| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true | +| iconType | Icon type, effective when `showIcon` is `true` | string | - | +| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` | + +### events +| Events Name | Description | Arguments | +| --- | --- | --- | +| close | Callback when Alert is closed | Function | diff --git a/components/alert/index.vue b/components/alert/index.vue new file mode 100644 index 000000000..613a1fe63 --- /dev/null +++ b/components/alert/index.vue @@ -0,0 +1,133 @@ + diff --git a/components/alert/index.zh-CN.md b/components/alert/index.zh-CN.md new file mode 100644 index 000000000..649e9b922 --- /dev/null +++ b/components/alert/index.zh-CN.md @@ -0,0 +1,18 @@ + +## API + +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| banner | 是否用作顶部公告 | boolean | false | +| closable | 默认不显示关闭按钮 | boolean | 无 | +| closeText | 自定义关闭按钮 | string\|slot | 无 | +| description | 警告提示的辅助性文字介绍 | string\|slot | 无 | +| message | 警告提示内容 | string\|slot | 无 | +| showIcon | 是否显示辅助图标 | boolean | false,`banner` 模式下默认值为 true | +| iconType | 自定义图标类型,`showIcon` 为 `true` 时有效 | string | - | +| type | 指定警告提示的样式,有四种选择 `success`、`info`、`warning`、`error` | string | `info`,`banner` 模式下默认值为 `warning` | + +### 事件 +| 事件名称 | 说明 | 回调参数 | +| --- | --- | --- | +| close | 关闭时触发的回调函数 | Function | diff --git a/components/alert/style/index.js b/components/alert/style/index.js new file mode 100644 index 000000000..cf31ed80f --- /dev/null +++ b/components/alert/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less' +import './index.less' diff --git a/components/alert/style/index.less b/components/alert/style/index.less new file mode 100644 index 000000000..dfcf65789 --- /dev/null +++ b/components/alert/style/index.less @@ -0,0 +1,169 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@alert-prefix-cls: ~"@{ant-prefix}-alert"; + +@alert-message-color: @heading-color; +@alert-text-color: @text-color; + +.@{alert-prefix-cls} { + .reset-component; + position: relative; + padding: 8px 15px 8px 37px; + border-radius: @border-radius-base; + + &&-no-icon { + padding: 8px 15px; + } + + &-icon { + top: 8px + @font-size-base * @line-height-base / 2 - @font-size-base / 2 + 1px; + left: 16px; + position: absolute; + } + + &-description { + font-size: @font-size-base; + line-height: 22px; + display: none; + } + + &-success { + border: @border-width-base @border-style-base ~`colorPalette("@{success-color}", 3)`; + background-color: ~`colorPalette("@{success-color}", 1)`; + .@{alert-prefix-cls}-icon { + color: @success-color; + } + } + + &-info { + border: @border-width-base @border-style-base ~`colorPalette("@{info-color}", 3)`; + background-color: ~`colorPalette("@{info-color}", 1)`; + .@{alert-prefix-cls}-icon { + color: @info-color; + } + } + + &-warning { + border: @border-width-base @border-style-base ~`colorPalette("@{warning-color}", 3)`; + background-color: ~`colorPalette("@{warning-color}", 1)`; + .@{alert-prefix-cls}-icon { + color: @warning-color; + } + } + + &-error { + border: @border-width-base @border-style-base ~`colorPalette("@{error-color}", 3)`; + background-color: ~`colorPalette("@{error-color}", 1)`; + .@{alert-prefix-cls}-icon { + color: @error-color; + } + } + + &-close-icon { + font-size: @font-size-sm; + position: absolute; + right: 16px; + top: 8px; + line-height: 22px; + overflow: hidden; + cursor: pointer; + + .@{iconfont-css-prefix}-cross { + color: @text-color-secondary; + transition: color .3s; + &:hover { + color: #404040; + } + } + } + + &-close-text { + position: absolute; + right: 16px; + } + + &-with-description { + padding: 15px 15px 15px 64px; + position: relative; + border-radius: @border-radius-base; + color: @text-color; + line-height: @line-height-base; + } + + &-with-description&-no-icon { + padding: 15px; + } + + &-with-description &-icon { + position: absolute; + top: 16px; + left: 24px; + font-size: 24px; + } + + &-with-description &-close-icon { + position: absolute; + top: 16px; + right: 16px; + cursor: pointer; + font-size: @font-size-base; + } + + &-with-description &-message { + font-size: @font-size-lg; + color: @alert-message-color; + display: block; + margin-bottom: 4px; + } + + &-with-description &-description { + display: block; + } + + &&-close { + height: 0 !important; + margin: 0; + padding-top: 0; + padding-bottom: 0; + transition: all .3s @ease-in-out-circ; + transform-origin: 50% 0; + } + + &-slide-up-leave { + animation: antAlertSlideUpOut .3s @ease-in-out-circ; + animation-fill-mode: both; + } + + &-banner { + border-radius: 0; + border: 0; + margin-bottom: 0; + } +} + +@keyframes antAlertSlideUpIn { + 0% { + opacity: 0; + transform-origin: 0% 0%; + transform: scaleY(0); + } + 100% { + opacity: 1; + transform-origin: 0% 0%; + transform: scaleY(1); + } +} + +@keyframes antAlertSlideUpOut { + 0% { + opacity: 1; + transform-origin: 0% 0%; + transform: scaleY(1); + } + 100% { + opacity: 0; + transform-origin: 0% 0%; + transform: scaleY(0); + } +} diff --git a/components/index.js b/components/index.js index 04b0ca7b7..972f9bdc8 100644 --- a/components/index.js +++ b/components/index.js @@ -88,23 +88,10 @@ export { default as Affix } from './affix' export { default as Cascader } from './cascader' export { default as BackTop } from './back-top' export { default as Modal } from './modal' -import { - info, - success, - error, - warning, - warn, - confirm, -} from './modal' +export { default as Alert } from './alert' const api = { notification, message, - modalInfo: info, - modalSuccess: success, - modalError: error, - modalWarning: warning, - modalWarn: warn, - modalConfirm: confirm, } export { api } diff --git a/components/modal/Modal.vue b/components/modal/Modal.vue index 81ff819d2..99893ae9d 100644 --- a/components/modal/Modal.vue +++ b/components/modal/Modal.vue @@ -63,6 +63,10 @@ export default { visible: false, okType: 'primary', }), + model: { + prop: 'visible', + event: 'change', + }, // static info: ModalFunc; // static success: ModalFunc; // static error: ModalFunc; @@ -72,6 +76,7 @@ export default { methods: { handleCancel (e) { this.$emit('cancel', e) + this.$emit('change', false) }, handleOk (e) { @@ -131,7 +136,7 @@ export default { props: { ...this.$props, title, - footer: typeof footer === undefined ? defaultFooter : footer, + footer: footer === undefined ? defaultFooter : footer, visible: visible, mousePosition, }, diff --git a/components/modal/confirm.js b/components/modal/confirm.js index 23365b493..a4781d986 100644 --- a/components/modal/confirm.js +++ b/components/modal/confirm.js @@ -2,7 +2,10 @@ import Vue from 'vue' import ConfirmDialog from './ConfirmDialog' export default function confirm (config) { const div = document.createElement('div') + const el = document.createElement('div') + div.appendChild(el) document.body.appendChild(div) + let confirmDialogInstance = null function close (...args) { destroy(...args) @@ -23,7 +26,7 @@ export default function confirm (config) { function render (props) { return new Vue({ - el: div, + el: el, render () { return }, diff --git a/components/modal/demo/async.md b/components/modal/demo/async.md new file mode 100644 index 000000000..b35ef6e5b --- /dev/null +++ b/components/modal/demo/async.md @@ -0,0 +1,57 @@ + + +#### 异步关闭 +点击确定后异步关闭对话框,例如提交表单。 + + + +#### Asynchronously close +Asynchronously close a modal dialog when a user clicked OK button, for example, +you can use this pattern when you submit a form. + + +```html + + +``` + diff --git a/components/modal/demo/basic.md b/components/modal/demo/basic.md index f955e32db..e041be603 100644 --- a/components/modal/demo/basic.md +++ b/components/modal/demo/basic.md @@ -15,9 +15,8 @@ Basic modal. Open

Some contents...

Some contents...

@@ -40,10 +39,6 @@ export default { console.log(e); this.visible = false }, - handleCancel(e) { - console.log(e); - this.visible = false - }, } } diff --git a/components/modal/demo/confirm-promise.md b/components/modal/demo/confirm-promise.md new file mode 100644 index 000000000..24106f6b5 --- /dev/null +++ b/components/modal/demo/confirm-promise.md @@ -0,0 +1,40 @@ + + +#### 确认对话框 +使用 `confirm()` 可以快捷地弹出确认框。onCancel/onOk 返回 promise 可以延迟关闭 + + + +#### Confirmation modal dialog +To use `confirm()` to popup confirmation modal dialog. Let onCancel/onOk function return a promise object to +delay closing the dialog. + + +```html + + +``` + diff --git a/components/modal/demo/confirm.md b/components/modal/demo/confirm.md index b5db87850..839f3f4bc 100644 --- a/components/modal/demo/confirm.md +++ b/components/modal/demo/confirm.md @@ -21,10 +21,12 @@ To use `confirm()` to popup a confirmation modal dialog. +``` + diff --git a/components/modal/demo/index.vue b/components/modal/demo/index.vue new file mode 100644 index 000000000..5dafd70f2 --- /dev/null +++ b/components/modal/demo/index.vue @@ -0,0 +1,63 @@ + + + diff --git a/components/modal/demo/info.md b/components/modal/demo/info.md new file mode 100644 index 000000000..bcfba8058 --- /dev/null +++ b/components/modal/demo/info.md @@ -0,0 +1,66 @@ + + +#### 信息提示 +各种类型的信息提示,只提供一个按钮用于关闭。 + + + +#### Information modal dialog +In the various types of information modal dialog, only one button to close dialog is provided. + + +```html + + +``` + diff --git a/components/modal/demo/locale.md b/components/modal/demo/locale.md new file mode 100644 index 000000000..ba3d40512 --- /dev/null +++ b/components/modal/demo/locale.md @@ -0,0 +1,60 @@ + + +#### 国际化 +设置 `okText` 与 `cancelText` 以自定义按钮文字。 + + + +#### Internationalization +To customize the text of the buttons, you need to set `okText` and `cancelText` props. + + +```html + + +``` + diff --git a/components/modal/demo/manual.md b/components/modal/demo/manual.md new file mode 100644 index 000000000..e8b2f3d2d --- /dev/null +++ b/components/modal/demo/manual.md @@ -0,0 +1,31 @@ + + +#### 手动移除 +手动关闭modal。 + + + +#### Manual to destroy +Manually destroying a modal. + + +```html + + +``` + diff --git a/components/modal/demo/position.md b/components/modal/demo/position.md new file mode 100644 index 000000000..1d868906b --- /dev/null +++ b/components/modal/demo/position.md @@ -0,0 +1,92 @@ + + +#### 自定义位置 +使用 `style.top` 或配合其他样式来设置对话框位置。 + + + +#### To customize the position of modal +You can use `style.top` or other styles to set position of modal dialog. + + +```html + + + +``` + diff --git a/components/modal/index.en-US.md b/components/modal/index.en-US.md new file mode 100644 index 000000000..92323c5cf --- /dev/null +++ b/components/modal/index.en-US.md @@ -0,0 +1,69 @@ + +## API + +| Property | Description | Type | Default | +| -------- | ----------- | ---- | ------- | +| afterClose | Specify a function that will be called when modal is closed completely. | function | - | +| bodyStyle | Body style for modal body element. Such as height, padding etc. | object | {} | +| cancelText | Text of the Cancel button | string\|slot | `Cancel` | +| closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | true | +| confirmLoading | Whether to apply loading visual effect for OK button or not | boolean | false | +| destroyOnClose | Whether to unmount child compenents on onClose | boolean | false | +| footer | Footer content, set as `:footer="null"` when you don't need default buttons | string\|slot | OK and Cancel buttons | +| getContainer | Return the mount node for Modal | (instance): HTMLElement | () => document.body | +| mask | Whether show mask or not. | Boolean | true | +| maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | boolean | true | +| maskStyle | Style for modal's mask element. | object | {} | +| okText | Text of the OK button | string\|slot | `OK` | +| okType | Button `type` of the OK button | string | `primary` | +| style | Style of floating layer, typically used at least for adjusting the position. | object | - | +| title | The modal dialog's title | string\|slot | - | +| visible | Whether the modal dialog is visible or not | boolean | false | +| width | Width of the modal dialog | string\|number | 520 | +| wrapClassName | The class name of the container of the modal dialog | string | - | +| zIndex | The `z-index` of the Modal | Number | 1000 | + +### events +| Events Name | Description | Arguments | +| --- | --- | --- | +| cancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button | function(e) | +| ok | Specify a function that will be called when a user clicks the OK button | function(e) | + +#### Note + +> The state of Modal will be preserved at it's component lifecycle by default, if you wish to open it with a brand new state everytime, set `destroyOnClose` on it. + +### Modal.method() + +There are five ways to display the information based on the content's nature: + +- `Modal.info` +- `Modal.success` +- `Modal.error` +- `Modal.warning` +- `Modal.confirm` + +The items listed above are all functions, expecting a settings object as parameter. +The properties of the object are follows: + +| Property | Description | Type | Default | +| -------- | ----------- | ---- | ------- | +| cancelText | Text of the Cancel button | string | `Cancel` | +| class | class of container | string | - | +| content | Content | string\|vNode | - | +| iconType | Icon `type` of the Icon component | string | `question-circle` | +| maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | Boolean | `false` | +| okText | Text of the OK button | string | `OK` | +| okType | Button `type` of the OK button | string | `primary` | +| title | Title | string\|vNode | - | +| width | Width of the modal dialog | string\|number | 416 | +| zIndex | The `z-index` of the Modal | Number | 1000 | +| onCancel | Specify a function that will be called when the user clicks the Cancel button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function | - | +| onOk | Specify a function that will be called when the user clicks the OK button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function | - | + +All the `Modal.method`s will return a reference, and then we can close the modal dialog by the reference. + +```jsx +const ref = Modal.info(); +ref.destroy(); +``` diff --git a/components/modal/index.js b/components/modal/index.js index 032891f54..759838756 100644 --- a/components/modal/index.js +++ b/components/modal/index.js @@ -53,14 +53,11 @@ const confirm = function (props) { } return modalConfirm(config) } - -export { - info, - success, - error, - warning, - warn, - confirm, -} +Modal.info = info +Modal.success = success +Modal.error = error +Modal.warning = warning +Modal.warn = warn +Modal.confirm = confirm export default Modal diff --git a/components/modal/index.zh-CN.md b/components/modal/index.zh-CN.md new file mode 100644 index 000000000..cb68f3e33 --- /dev/null +++ b/components/modal/index.zh-CN.md @@ -0,0 +1,67 @@ +## API + +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| afterClose | Modal 完全关闭后的回调 | function | 无 | +| bodyStyle | Modal body 样式 | object | {} | +| cancelText | 取消按钮文字 | string\| slot | 取消 | +| closable | 是否显示右上角的关闭按钮 | boolean | true | +| confirmLoading | 确定按钮 loading | boolean | 无 | +| destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false | +| footer | 底部内容,当不需要默认底部按钮时,可以设为 `:footer="null"` | string\|slot | 确定取消按钮 | +| getContainer | 指定 Modal 挂载的 HTML 节点 | (instance): HTMLElement | () => document.body | +| mask | 是否展示遮罩 | Boolean | true | +| maskClosable | 点击蒙层是否允许关闭 | boolean | true | +| maskStyle | 遮罩样式 | object | {} | +| okText | 确认按钮文字 | string\|slot | 确定 | +| okType | 确认按钮类型 | string | primary | +| style | 可用于设置浮层的样式,调整浮层位置等 | object | - | +| title | 标题 | string\|slot | 无 | +| visible(v-model) | 对话框是否可见 | boolean | 无 | +| width | 宽度 | string\|number | 520 | +| wrapClassName | 对话框外层容器的类名 | string | - | +| zIndex | 设置 Modal 的 `z-index` | Number | 1000 | + +### 事件 +| 事件名称 | 说明 | 回调参数 | +| --- | --- | --- | +| cancel | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | +| ok | 点击确定回调 | function(e) | + +#### 注意 + +> `` 默认关闭后状态不会自动清空, 如果希望每次打开都是新内容,请设置 `destroyOnClose`。 + +### Modal.method() + +包括: + +- `Modal.info` +- `Modal.success` +- `Modal.error` +- `Modal.warning` +- `Modal.confirm` + +以上均为一个函数,参数为 object,具体属性如下: + +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| cancelText | 取消按钮文字 | string | 取消 | +| class | 容器类名 | string | - | +| content | 内容 | string\|vNode | 无 | +| iconType | 图标 Icon 类型 | string | question-circle | +| maskClosable | 点击蒙层是否允许关闭 | Boolean | `false` | +| okText | 确认按钮文字 | string | 确定 | +| okType | 确认按钮类型 | string | primary | +| title | 标题 | string\|vNode | 无 | +| width | 宽度 | string\|number | 416 | +| zIndex | 设置 Modal 的 `z-index` | Number | 1000 | +| onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 | +| onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 | + +以上函数调用后,会返回一个引用,可以通过该引用关闭弹窗。 + +```jsx +const ref = Modal.info(); +ref.destroy(); +``` diff --git a/components/style.js b/components/style.js index 82f50e0d0..37fe86642 100644 --- a/components/style.js +++ b/components/style.js @@ -28,3 +28,4 @@ import './affix/style' import './cascader/style' import './back-top/style' import './modal/style' +import './alert/style' diff --git a/components/vc-dialog/DialogWrap.vue b/components/vc-dialog/DialogWrap.vue index 567b42e55..c917a1230 100644 --- a/components/vc-dialog/DialogWrap.vue +++ b/components/vc-dialog/DialogWrap.vue @@ -20,9 +20,10 @@ const DialogWrap = { if (this.visible) { this.renderComponent({ afterClose: this.removeContainer, - onClose () { - }, visible: false, + on: { + close () {}, + }, }) } else { this.removeContainer() @@ -31,18 +32,21 @@ const DialogWrap = { methods: { getComponent (extra = {}) { const { $attrs, $listeners, $props, $slots } = this - + const { on, ...otherProps } = extra const dialogProps = { props: { ...$props, dialogClass: getClass(this), dialogStyle: getStyle(this), - ...extra, + ...otherProps, }, attrs: $attrs, ref: '_component', key: 'dialog', - on: $listeners, + on: { + ...$listeners, + ...on, + }, } return ( {$slots.default} diff --git a/contributors.md b/contributors.md index f4b7946a3..cead70e6b 100644 --- a/contributors.md +++ b/contributors.md @@ -22,7 +22,7 @@ AutoComplete | done Affix | done Cascader | done BackTop | done -Modal +Modal | done Alert Calendar DatePicker diff --git a/examples/demo.js b/examples/demo.js index c0e556563..7f1d4667d 100644 --- a/examples/demo.js +++ b/examples/demo.js @@ -28,3 +28,5 @@ export { default as autoComplete } from 'antd/auto-complete/demo/index.vue' export { default as affix } from 'antd/affix/demo/index.vue' export { default as cascader } from 'antd/cascader/demo/index.vue' export { default as backTop } from 'antd/back-top/demo/index.vue' +export { default as modal } from 'antd/modal/demo/index.vue' +export { default as alert } from 'antd/alert/demo/index.vue' diff --git a/examples/routes.js b/examples/routes.js index ed8f5d208..54f627721 100644 --- a/examples/routes.js +++ b/examples/routes.js @@ -3,7 +3,7 @@ const AsyncComp = () => { const hashs = window.location.hash.split('/') const d = hashs[hashs.length - 1] return { - component: import(`../components/vc-steps/demo/${d}`), + component: import(`../components/alert/demo/${d}`), } } export default [