mirror of https://github.com/ElemeFE/element
Changelog: update for 1.4.8 (#7683)
* Table: Trigger `doLayout` when display from `none` to others * Changelog: update for 1.4.8pull/7695/head
parent
5698e77c72
commit
664f893086
|
@ -1,5 +1,13 @@
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### 1.4.8
|
||||||
|
|
||||||
|
*2017-10-24*
|
||||||
|
|
||||||
|
- Fixed SubMenu retracting when moving the mouse rapidly on the SubMenu of collapsed Menu, #7579
|
||||||
|
- Fixed hidden last shortcut of DateTimePicker when the shortcut menu is long, #7567 (by @DuLinRain)
|
||||||
|
- Added `show-timeout` and `hide-timeout` attributes for Dropdown, #7621 (by @phongkt-dev)
|
||||||
|
|
||||||
### 1.4.7
|
### 1.4.7
|
||||||
|
|
||||||
*2017-10-16*
|
*2017-10-16*
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
|
### 1.4.8
|
||||||
|
*2017-10-24*
|
||||||
|
|
||||||
|
- 修复鼠标在折叠的 Menu 子菜单中快速移动时会将菜单收起的问题,#7579
|
||||||
|
- 修复 DateTimePicker 的快捷菜单过长时,最后一项会被隐藏的问题,#7567(by @DuLinRain)
|
||||||
|
- 新增 Dropdown 的 `show-timeout` 和 `hide-timeout` 属性,#7621(by @phongkt-dev)
|
||||||
|
|
||||||
### 1.4.7
|
### 1.4.7
|
||||||
*2017-10-16*
|
*2017-10-16*
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,8 @@
|
||||||
| menu-align | 菜单水平对齐方向 | string | start, end | end |
|
| menu-align | 菜单水平对齐方向 | string | start, end | end |
|
||||||
| trigger | 触发下拉的行为 | string | hover, click | hover |
|
| trigger | 触发下拉的行为 | string | hover, click | hover |
|
||||||
| hide-on-click | 是否在点击菜单项后隐藏菜单 | boolean | — | true |
|
| hide-on-click | 是否在点击菜单项后隐藏菜单 | boolean | — | true |
|
||||||
|
| show-timeout | 展开下拉菜单的延时 | number | — | 250 |
|
||||||
|
| hide-timeout | 收起下拉菜单的延时 | number | — | 150 |
|
||||||
|
|
||||||
### Dropdown Events
|
### Dropdown Events
|
||||||
| 事件名称 | 说明 | 回调参数 |
|
| 事件名称 | 说明 | 回调参数 |
|
||||||
|
|
|
@ -10,6 +10,11 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div><% if (process.env.NODE_ENV === 'production') { %>
|
<div id="app"></div><% if (process.env.NODE_ENV === 'production') { %>
|
||||||
<!--<script src="https://app.codesponsor.io/scripts/qFcVkt4f3DQEg4zrwINGVg?theme=light&height=250&width=240"></script>-->
|
<!--<script src="https://app.codesponsor.io/scripts/qFcVkt4f3DQEg4zrwINGVg?theme=light&height=250&width=240"></script>-->
|
||||||
|
<script>
|
||||||
|
if (!window.Promise) {
|
||||||
|
document.write('<script src="//shadow.elemecdn.com/npm/es6-promise@4.1.1/dist/es6-promise.min.js"><\/script><script>ES6Promise.polyfill()<\/script>')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<script src="//cdn.jsdelivr.net/npm/vue@2.3.0/dist/vue.runtime.min.js"></script>
|
<script src="//cdn.jsdelivr.net/npm/vue@2.3.0/dist/vue.runtime.min.js"></script>
|
||||||
<script src="//cdn.jsdelivr.net/npm/vue-router@2.1.1/dist/vue-router.min.js"></script><% } %>
|
<script src="//cdn.jsdelivr.net/npm/vue-router@2.1.1/dist/vue-router.min.js"></script><% } %>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -296,6 +296,9 @@
|
||||||
}
|
}
|
||||||
if (this.$el) {
|
if (this.$el) {
|
||||||
this.isHidden = this.$el.clientWidth === 0;
|
this.isHidden = this.$el.clientWidth === 0;
|
||||||
|
if (this.isHidden && this.layout.bodyWidth) {
|
||||||
|
setTimeout(() => this.doLayout());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -831,84 +831,6 @@ describe('Table', () => {
|
||||||
}, DELAY);
|
}, DELAY);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('reserve-selection', done => {
|
|
||||||
const getData = function(page = 0) {
|
|
||||||
let id = 0;
|
|
||||||
const rows = [];
|
|
||||||
const row = () => {
|
|
||||||
return {
|
|
||||||
id: ++id + page * 10,
|
|
||||||
date: new Date().getTime()
|
|
||||||
};
|
|
||||||
};
|
|
||||||
let count = 10;
|
|
||||||
|
|
||||||
while (--count) {
|
|
||||||
rows.push(row());
|
|
||||||
}
|
|
||||||
return rows;
|
|
||||||
};
|
|
||||||
const vm = createVue({
|
|
||||||
template: `
|
|
||||||
<el-table ref="table" :row-key="rowKey" :data="testData" @selection-change="change">
|
|
||||||
<el-table-column type="selection" reserve-selection />
|
|
||||||
<el-table-column prop="id" label="id" />
|
|
||||||
<el-table-column prop="date" label="date" />
|
|
||||||
</el-table>
|
|
||||||
`,
|
|
||||||
|
|
||||||
created() {
|
|
||||||
this.testData = getData();
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return { selected: [], testData: [] };
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
rowKey(row) {
|
|
||||||
return row.id;
|
|
||||||
},
|
|
||||||
|
|
||||||
change(rows) {
|
|
||||||
this.selected = rows;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, true);
|
|
||||||
|
|
||||||
setTimeout(_ => {
|
|
||||||
// click first
|
|
||||||
vm.$el.querySelectorAll('.el-checkbox')[1].click();
|
|
||||||
|
|
||||||
setTimeout(_ => {
|
|
||||||
expect(vm.$el.querySelectorAll('.el-checkbox__input.is-checked')).to.length(1);
|
|
||||||
// go to second page
|
|
||||||
vm.testData = getData(1);
|
|
||||||
setTimeout(_ => {
|
|
||||||
// expect no checked
|
|
||||||
expect(vm.$el.querySelectorAll('.el-checkbox__input.is-checked')).to.length(0);
|
|
||||||
// click first checkbox
|
|
||||||
vm.$el.querySelectorAll('.el-checkbox')[1].click();
|
|
||||||
vm.$el.querySelectorAll('.el-checkbox')[2].click();
|
|
||||||
setTimeout(_ => {
|
|
||||||
// back first page
|
|
||||||
vm.testData = getData();
|
|
||||||
setTimeout(_ => {
|
|
||||||
expect(vm.$el.querySelectorAll('.el-checkbox__input.is-checked')).to.length(1);
|
|
||||||
// clear
|
|
||||||
vm.$refs.table.clearSelection();
|
|
||||||
setTimeout(_ => {
|
|
||||||
expect(vm.$el.querySelectorAll('.el-checkbox__input.is-checked')).to.length(0);
|
|
||||||
destroyVM(vm);
|
|
||||||
done();
|
|
||||||
}, DELAY);
|
|
||||||
}, DELAY);
|
|
||||||
}, DELAY);
|
|
||||||
}, DELAY);
|
|
||||||
}, DELAY);
|
|
||||||
}, DELAY);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('type', () => {
|
describe('type', () => {
|
||||||
const createTable = function(type) {
|
const createTable = function(type) {
|
||||||
return createVue({
|
return createVue({
|
||||||
|
|
Loading…
Reference in New Issue