chore: add trailingComma
This commit is contained in:
@@ -27,23 +27,23 @@ export default {
|
||||
i18n: {
|
||||
'zh-CN': {
|
||||
offsetTop: '吸顶距离',
|
||||
setContainer: '指定容器'
|
||||
setContainer: '指定容器',
|
||||
},
|
||||
'en-US': {
|
||||
offsetTop: 'Offset Top',
|
||||
setContainer: 'Set Container'
|
||||
}
|
||||
setContainer: 'Set Container',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
container: null
|
||||
container: null,
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.container = this.$refs.container;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
+9
-9
@@ -13,7 +13,7 @@ export default createComponent({
|
||||
|
||||
bind(this.scroller, 'scroll', this.onScroll, true);
|
||||
this.onScroll();
|
||||
})
|
||||
}),
|
||||
],
|
||||
|
||||
props: {
|
||||
@@ -21,15 +21,15 @@ export default createComponent({
|
||||
container: null,
|
||||
offsetTop: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
fixed: false,
|
||||
height: 0,
|
||||
transform: 0
|
||||
transform: 0,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -54,7 +54,7 @@ export default createComponent({
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -68,7 +68,7 @@ export default createComponent({
|
||||
const emitScrollEvent = () => {
|
||||
this.$emit('scroll', {
|
||||
scrollTop,
|
||||
isFixed: this.fixed
|
||||
isFixed: this.fixed,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -99,13 +99,13 @@ export default createComponent({
|
||||
}
|
||||
|
||||
emitScrollEvent();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
render() {
|
||||
const { fixed } = this;
|
||||
const style = {
|
||||
height: fixed ? `${this.height}px` : null
|
||||
height: fixed ? `${this.height}px` : null,
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -115,5 +115,5 @@ export default createComponent({
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ test('sticky to top', () => {
|
||||
<van-sticky style="height: 10px;">
|
||||
Content
|
||||
</van-sticky>
|
||||
`
|
||||
`,
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -21,7 +21,7 @@ test('z-index prop', () => {
|
||||
<van-sticky style="height: 10px;" :z-index="0">
|
||||
Content
|
||||
</van-sticky>
|
||||
`
|
||||
`,
|
||||
});
|
||||
|
||||
mockScrollTop(100);
|
||||
@@ -35,7 +35,7 @@ test('offset-top prop', () => {
|
||||
<van-sticky style="height: 10px;" :offset-top="10">
|
||||
Content
|
||||
</van-sticky>
|
||||
`
|
||||
`,
|
||||
});
|
||||
|
||||
mockScrollTop(100);
|
||||
@@ -54,12 +54,12 @@ test('container prop', () => {
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
container: null
|
||||
container: null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.container = this.$refs.container;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
mockScrollTop(15);
|
||||
|
||||
Reference in New Issue
Block a user