Merge branch '2.x' into dev

This commit is contained in:
chenjiahan
2020-12-26 15:52:18 +08:00
10 changed files with 96 additions and 31 deletions
+8 -4
View File
@@ -110,13 +110,17 @@ export default createComponent({
const trackStyle = computed(() => {
const mainAxis = props.vertical ? 'height' : 'width';
const crossAxis = props.vertical ? 'width' : 'height';
return {
[mainAxis]: `${trackSize.value}px`,
[crossAxis]: props[crossAxis] ? `${props[crossAxis]}px` : '',
const style = {
transitionDuration: `${state.swiping ? 0 : props.duration}ms`,
transform: `translate${props.vertical ? 'Y' : 'X'}(${state.offset}px)`,
};
if (size.value) {
style[mainAxis] = `${trackSize.value}px`;
style[crossAxis] = props[crossAxis] ? `${props[crossAxis]}px` : '';
}
return style;
});
const getTargetActive = (pace) => {