diff --git a/components/_util/ContainerRender.vue b/components/_util/ContainerRender.vue
index 839c4f7d7..d949112bc 100644
--- a/components/_util/ContainerRender.vue
+++ b/components/_util/ContainerRender.vue
@@ -60,12 +60,9 @@ export default {
})
},
render () {
- console.log(props)
return getComponent(props)
},
})
- } else {
- this._component.$forceUpdate()
}
}
},
diff --git a/components/_util/props-util.js b/components/_util/props-util.js
index 6ee8a3f30..ea74b6b4f 100644
--- a/components/_util/props-util.js
+++ b/components/_util/props-util.js
@@ -111,7 +111,14 @@ export function getClass (ele) {
} else if (ele.$vnode && ele.$vnode.data) {
data = ele.$vnode.data
}
- return data.class || data.staticClass
+ const tempCls = data.class || data.staticClass
+ let cls = {}
+ if (typeof tempCls === 'string') {
+ tempCls.split(' ').forEach(c => { cls[c.trim()] = true })
+ } else {
+ cls = tempCls
+ }
+ return cls
}
export function getStyle (ele) {
let data = {}
@@ -138,6 +145,10 @@ export function isEmptyElement (ele) {
export function filterEmpty (children = []) {
return children.filter(c => c.tag || c.text.trim() !== '')
}
+const initDefaultProps = (propTypes, defaultProps) => {
+ Object.keys(defaultProps).forEach(k => { propTypes[k] = propTypes[k].def(defaultProps[k]) })
+ return propTypes
+}
export {
hasProp,
filterProps,
@@ -150,5 +161,6 @@ export {
getAttrs,
getValueByProp,
parseStyleText,
+ initDefaultProps,
}
export default hasProp
diff --git a/components/index.js b/components/index.js
index 6b22f7e23..04b0ca7b7 100644
--- a/components/index.js
+++ b/components/index.js
@@ -72,12 +72,6 @@ import message from './message'
export { default as Spin } from './spin'
-const api = {
- notification,
- message,
-}
-export { api }
-
import Select from './select'
const SelectOption = Select.Option
const SelectOptGroup = Select.OptGroup
@@ -93,4 +87,24 @@ 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'
+const api = {
+ notification,
+ message,
+ modalInfo: info,
+ modalSuccess: success,
+ modalError: error,
+ modalWarning: warning,
+ modalWarn: warn,
+ modalConfirm: confirm,
+}
+export { api }
diff --git a/components/modal/ActionButton.vue b/components/modal/ActionButton.vue
new file mode 100644
index 000000000..9ec46761a
--- /dev/null
+++ b/components/modal/ActionButton.vue
@@ -0,0 +1,70 @@
+
diff --git a/components/modal/ConfirmDialog.vue b/components/modal/ConfirmDialog.vue
new file mode 100644
index 000000000..bec01ce92
--- /dev/null
+++ b/components/modal/ConfirmDialog.vue
@@ -0,0 +1,71 @@
+
diff --git a/components/modal/Modal.vue b/components/modal/Modal.vue
new file mode 100644
index 000000000..81ff819d2
--- /dev/null
+++ b/components/modal/Modal.vue
@@ -0,0 +1,153 @@
+
diff --git a/components/modal/confirm.js b/components/modal/confirm.js
new file mode 100644
index 000000000..23365b493
--- /dev/null
+++ b/components/modal/confirm.js
@@ -0,0 +1,39 @@
+import Vue from 'vue'
+import ConfirmDialog from './ConfirmDialog'
+export default function confirm (config) {
+ const div = document.createElement('div')
+ document.body.appendChild(div)
+ let confirmDialogInstance = null
+ function close (...args) {
+ destroy(...args)
+ }
+
+ function destroy (...args) {
+ if (confirmDialogInstance && div.parentNode) {
+ confirmDialogInstance.$destroy()
+ confirmDialogInstance = null
+ div.parentNode.removeChild(div)
+ }
+ const triggerCancel = args && args.length &&
+ args.some(param => param && param.triggerCancel)
+ if (config.onCancel && triggerCancel) {
+ config.onCancel(...args)
+ }
+ }
+
+ function render (props) {
+ return new Vue({
+ el: div,
+ render () {
+ return Some contents... Some contents... Some contents...