diff --git a/examples/routers/modal.vue b/examples/routers/modal.vue
index 680b527..0ff08dd 100644
--- a/examples/routers/modal.vue
+++ b/examples/routers/modal.vue
@@ -1,18 +1,67 @@
对话框内容 对话框内容 对话框内容
一些对话框内容
一些对话框内容
', - render: (h) => { - return h('Input', { - props: { - value: this.val, - autofocus: true - }, - on: { - input: (val) => { - this.val = val; - } - } - }, '一个按钮') - }, - onOk: () => { - this.$Message.info('点击了确定'); - }, - onCancel: () => { - this.$Message.info('点击了取消'); - } - }); - }, - custom () { - this.$Modal.confirm({ - title: '确认对话框标题', - content: '一些对话框内容
一些对话框内容
', - okText: 'OK', - cancelText: 'Cancel' - }); - }, - async () { - this.$Modal.confirm({ - title: '确认对话框标题', - content: '对话框将在 2秒 后关闭
', - loading: true, - onOk: () => { - setTimeout(() => { - this.$Modal.remove(); - this.$Message.info('异步关闭了对话框'); - }, 2000); - } - }); + remoteMethod1 (query) { + if (query !== '') { + this.loading1 = true; + setTimeout(() => { + this.loading1 = false; + const list = this.list.map(item => { + return { + value: item, + label: item + }; + }); + this.options1 = list.filter(item => item.label.toLowerCase().indexOf(query.toLowerCase()) > -1); + }, 200); + } else { + this.options1 = []; + } } } } diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue index 17440cb..037a9f0 100644 --- a/src/components/modal/modal.vue +++ b/src/components/modal/modal.vue @@ -121,8 +121,9 @@ mainStyles () { let style = {}; + const width = parseInt(this.width); const styleWidth = { - width: `${this.width}px` + width: width <= 100 ? `${width}%` : `${width}px` }; const customStyle = this.styles ? this.styles : {}; -- libgit2 0.21.4