+
显示普通提示
显示成功提示
显示警告提示
显示错误提示
@@ -9,6 +10,17 @@
diff --git a/examples/routers/select.vue b/examples/routers/select.vue
index b2986b89..90a52417 100644
--- a/examples/routers/select.vue
+++ b/examples/routers/select.vue
@@ -1,166 +1,166 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.label }}
-
-
-
-
- {{ item.label }}
-
-
-
- set
-
+
+ {{model}}
+
+
+ {{option.label}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/routers/table.vue b/examples/routers/table.vue
index 6f52f0c1..41b5c4ad 100644
--- a/examples/routers/table.vue
+++ b/examples/routers/table.vue
@@ -84,7 +84,8 @@
{
name: '张小刚',
age: 25,
- address: '北京市海淀区西二旗'
+ address: '北京市海淀区西二旗',
+ _disableExpand: true
},
{
name: '李小红',
diff --git a/examples/routers/tabs.vue b/examples/routers/tabs.vue
index 72dd6500..ea1f6be8 100644
--- a/examples/routers/tabs.vue
+++ b/examples/routers/tabs.vue
@@ -1,6 +1,6 @@
-
-
+
+
@@ -15,6 +15,12 @@
export default {
data () {
return {
+ label1: (h) => {
+ return h('div', [
+ h('span', '标签一'),
+ h('Button', 'button')
+ ]);
+ },
columns1: [
{
title: '姓名',
diff --git a/package.json b/package.json
index befcef38..18419777 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "iview",
- "version": "2.0.0-rc.14",
+ "version": "2.0.0-rc.15",
"title": "iView",
"description": "A high quality UI components Library with Vue.js",
"homepage": "http://www.iviewui.com",
diff --git a/src/components/badge/badge.vue b/src/components/badge/badge.vue
index cc1880d6..688b4626 100644
--- a/src/components/badge/badge.vue
+++ b/src/components/badge/badge.vue
@@ -61,17 +61,9 @@
}
return status;
- }
- },
- data () {
- return {
- alone: false
- };
- },
- mounted () {
- const child_length = this.$refs.badge.children.length;
- if (child_length === 1) {
- this.alone = true;
+ },
+ alone () {
+ return this.$slots.default === undefined;
}
}
};
diff --git a/src/components/base/collapse-transition.js b/src/components/base/collapse-transition.js
new file mode 100644
index 00000000..4c3c43dc
--- /dev/null
+++ b/src/components/base/collapse-transition.js
@@ -0,0 +1,79 @@
+// Thanks to https://github.com/ElemeFE/element/blob/dev/src/transitions/collapse-transition.js
+
+import { addClass, removeClass } from '../../utils/assist';
+
+const Transition = {
+ beforeEnter(el) {
+ addClass(el, 'collapse-transition');
+ if (!el.dataset) el.dataset = {};
+
+ el.dataset.oldPaddingTop = el.style.paddingTop;
+ el.dataset.oldPaddingBottom = el.style.paddingBottom;
+
+ el.style.height = '0';
+ el.style.paddingTop = 0;
+ el.style.paddingBottom = 0;
+ },
+
+ enter(el) {
+ el.dataset.oldOverflow = el.style.overflow;
+ if (el.scrollHeight !== 0) {
+ el.style.height = el.scrollHeight + 'px';
+ el.style.paddingTop = el.dataset.oldPaddingTop;
+ el.style.paddingBottom = el.dataset.oldPaddingBottom;
+ } else {
+ el.style.height = '';
+ el.style.paddingTop = el.dataset.oldPaddingTop;
+ el.style.paddingBottom = el.dataset.oldPaddingBottom;
+ }
+
+ el.style.overflow = 'hidden';
+ },
+
+ afterEnter(el) {
+ // for safari: remove class then reset height is necessary
+ removeClass(el, 'collapse-transition');
+ el.style.height = '';
+ el.style.overflow = el.dataset.oldOverflow;
+ },
+
+ beforeLeave(el) {
+ if (!el.dataset) el.dataset = {};
+ el.dataset.oldPaddingTop = el.style.paddingTop;
+ el.dataset.oldPaddingBottom = el.style.paddingBottom;
+ el.dataset.oldOverflow = el.style.overflow;
+
+ el.style.height = el.scrollHeight + 'px';
+ el.style.overflow = 'hidden';
+ },
+
+ leave(el) {
+ if (el.scrollHeight !== 0) {
+ // for safari: add class after set height, or it will jump to zero height suddenly, weired
+ addClass(el, 'collapse-transition');
+ el.style.height = 0;
+ el.style.paddingTop = 0;
+ el.style.paddingBottom = 0;
+ }
+ },
+
+ afterLeave(el) {
+ removeClass(el, 'collapse-transition');
+ el.style.height = '';
+ el.style.overflow = el.dataset.oldOverflow;
+ el.style.paddingTop = el.dataset.oldPaddingTop;
+ el.style.paddingBottom = el.dataset.oldPaddingBottom;
+ }
+};
+
+export default {
+ name: 'CollapseTransition',
+ functional: true,
+ render(h, { children }) {
+ const data = {
+ on: Transition
+ };
+
+ return h('transition', data, children);
+ }
+};
diff --git a/src/components/base/notification/index.js b/src/components/base/notification/index.js
index 7ab2c625..0c06aa27 100644
--- a/src/components/base/notification/index.js
+++ b/src/components/base/notification/index.js
@@ -1,24 +1,21 @@
import Notification from './notification.vue';
import Vue from 'vue';
-import { camelcaseToHyphen } from '../../../utils/assist';
Notification.newInstance = properties => {
const _props = properties || {};
- let props = '';
- Object.keys(_props).forEach(prop => {
- props += ' :' + camelcaseToHyphen(prop) + '=' + prop;
+ const Instance = new Vue({
+ data: _props,
+ render (h) {
+ return h(Notification, {
+ props: _props
+ });
+ }
});
- const div = document.createElement('div');
- div.innerHTML = ` `;
- document.body.appendChild(div);
-
- const notification = new Vue({
- el: div,
- data: _props,
- components: { Notification }
- }).$children[0];
+ const component = Instance.$mount();
+ document.body.appendChild(component.$el);
+ const notification = Instance.$children[0];
return {
notice (noticeProps) {
@@ -28,10 +25,10 @@ Notification.newInstance = properties => {
notification.close(name);
},
component: notification,
- destroy () {
+ destroy (element) {
notification.closeAll();
setTimeout(function() {
- document.body.removeChild(document.getElementsByClassName('ivu-message')[0].parentElement);
+ document.body.removeChild(document.getElementsByClassName(element)[0]);
}, 500);
}
};
diff --git a/src/components/base/notification/notice.vue b/src/components/base/notification/notice.vue
index dfa0c652..bec1f2fe 100644
--- a/src/components/base/notification/notice.vue
+++ b/src/components/base/notification/notice.vue
@@ -1,10 +1,20 @@
@@ -19,6 +29,9 @@
type: Number,
default: 1.5
},
+ type: {
+ type: String
+ },
content: {
type: String,
default: ''
diff --git a/src/components/base/notification/notification.vue b/src/components/base/notification/notification.vue
index 9695b55e..f3750f6b 100644
--- a/src/components/base/notification/notification.vue
+++ b/src/components/base/notification/notification.vue
@@ -5,6 +5,7 @@
:key="notice.name"
:prefix-cls="prefixCls"
:styles="notice.styles"
+ :type="notice.type"
:content="notice.content"
:duration="notice.duration"
:closable="notice.closable"
diff --git a/src/components/base/render.vue b/src/components/base/render.vue
new file mode 100644
index 00000000..7f2209c4
--- /dev/null
+++ b/src/components/base/render.vue
@@ -0,0 +1,30 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/components/collapse/panel.vue b/src/components/collapse/panel.vue
index f6c0ae0f..80c955ae 100644
--- a/src/components/collapse/panel.vue
+++ b/src/components/collapse/panel.vue
@@ -4,18 +4,21 @@
-