jiaqingjiayi-xiaochengxu/甲情_甲意/node_modules/antd-mini/less/SwipeAction/wechat.js

47 lines
1.7 KiB
JavaScript
Raw Normal View History

2024-11-15 03:51:28 +00:00
import { __assign, __rest } from "tslib";
import { platform } from '../_util/platform';
export function transformOptions(original) {
if (platform() === 'wechat') {
var props = original.props, didMount_1 = original.didMount, didUpdate = original.didUpdate, rest = __rest(original, ["props", "didMount", "didUpdate"]);
return __assign(__assign({}, rest), { properties: transformProperties(props), lifetimes: {
attached: function () {
return didMount_1.call(this);
},
}, options: {
multipleSlots: true,
styleIsolation: 'shared',
}, observers: {
'damping, swiped': function () {
this.setData({
swipeX: 0,
swipedR: false,
swipedL: false,
tapTypeL: '',
tapTypeR: '',
});
},
'elasticity': function (elasticity) {
this.setData({
swipeX: 0,
swipedR: false,
swipedL: false,
tapTypeL: '',
tapTypeR: '',
});
this.setData({ inertiaWidth: elasticity ? 20 : 0 });
},
} });
}
return __assign({}, original);
}
export function transformProperties(props) {
var properties = {};
Object.keys(props).forEach(function (key) {
properties[key] = {
type: null,
value: props[key],
};
});
return properties;
}