import { defineComponent, watch, reactive } from 'vue';
import sit from '@ungeui/transit';
const transit = defineComponent({
    name: 'transit',
    props: {
        duration: {
            type: Number,
            default: 500,
        },
    },
    setup(props, { slots }) {
        var _a, _b, _c;
        const o = reactive({
            value: Number((_c = (_b = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.children),
        });
        watch(() => { var _a, _b, _c; return (_c = (_b = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.children; }, (newValue, oldValue) => {
            console.log(newValue, oldValue);
            sit(o, {
                duration: props.duration,
                key: 'value',
                value: Number(newValue),
            });
        });
        return () => <>{o.value.toFixed()}</>;
    },
});
export default transit;
