Skip to content

Commit 6cfaa2f

Browse files
committed
build: build 2.0.0-beta.2
1 parent 69810a3 commit 6cfaa2f

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zarm-vue",
3-
"version": "2.0.0-beta.1",
3+
"version": "2.0.0-beta.2",
44
"description": "zarm in vue",
55
"tags": [
66
"zarm",

src/mixins/scrollable.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export default {
3232
};
3333
},
3434
mounted() {
35-
this.documentBodyStyle = document.body.style;
35+
const { top, position, width } = document.body.style;
36+
this.documentBodyStyle = { top, position, width };
3637
},
3738
beforeDestroy() {
3839
this.onAfterClose();
@@ -50,8 +51,11 @@ export default {
5051
},
5152
onAfterClose() {
5253
if (!this.documentScrollble) return;
53-
document.body.style = this.documentBodyStyle;
54-
// console.log(this.documentScrollTop);
54+
const { top, position, width } = this.documentBodyStyle;
55+
// fixed ios10, android5.x readonly property bug
56+
document.body.style.position = position;
57+
document.body.style.width = width;
58+
document.body.style.top = top;
5559
// scrollTop lost after set position:fixed, restore it back.
5660
setScrollTop(this.documentScrollTop);
5761
},

test/unit/specs/picker.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('Picker', () => {
4646
},
4747
});
4848
wrapper.element.click();
49-
expect(wrapper.findComponent({ name: 'zaPicker' }).vm.currentValue[0]).toBe('1');
49+
expect(wrapper.find({ name: 'zaPicker' }).vm.currentValue[0]).toBe('1');
5050
});
5151

5252
it('single column', () => {
@@ -70,7 +70,7 @@ describe('Picker', () => {
7070
},
7171
});
7272
wrapper.element.click();
73-
expect(wrapper.findComponent({ name: 'zaPicker' }).vm.currentValue[0]).toBe('1');
73+
expect(wrapper.find({ name: 'zaPicker' }).vm.currentValue[0]).toBe('1');
7474
});
7575

7676
it('multi columns', () => {

test/unit/specs/toast.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ describe('Toast', () => {
4242
const wrapper = mount(TestCompo);
4343
const { vm } = wrapper;
4444

45-
expect(vm.$el.classList.contains('za-toast--open')).toBe(true);
45+
expect(wrapper.find('.za-toast--open')).toBeTruthy();
4646
setTimeout(() => {
47-
expect(vm.$el.classList.contains('za-toast--open')).toBe(false);
47+
expect(wrapper.find('.za-toast--open')).toBeTruthy();
4848
vm.visible = true;
4949
setTimeout(() => {
50-
expect(vm.$el.classList.contains('za-toast--open')).toBe(true);
50+
expect(wrapper.find('.za-toast--open')).toBeTruthy();
5151
done();
5252
}, 30);
5353
}, 60);

0 commit comments

Comments
 (0)