Skip to content

Commit b522a6e

Browse files
committed
chore(.gitignore): track dist
1 parent 1f2aa47 commit b522a6e

File tree

4 files changed

+143
-1
lines changed

4 files changed

+143
-1
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pnpm-debug.log*
88
lerna-debug.log*
99

1010
node_modules
11-
dist
11+
# dist
1212
dist-ssr
1313
*.local
1414

dist/countup.vue.d.ts

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { CountUp } from 'countup.js';
2+
import type { CountUpOptions } from 'countup.js';
3+
declare const _default: import("vue").DefineComponent<{
4+
endVal: {
5+
type: import("vue").PropType<string | number>;
6+
required: true;
7+
};
8+
startVal: {
9+
type: import("vue").PropType<string | number>;
10+
} & {
11+
default: number;
12+
};
13+
duration: {
14+
type: import("vue").PropType<string | number>;
15+
} & {
16+
default: number;
17+
};
18+
autoplay: {
19+
type: import("vue").PropType<boolean>;
20+
} & {
21+
default: boolean;
22+
};
23+
options: {
24+
type: import("vue").PropType<CountUpOptions>;
25+
} & {
26+
default: undefined;
27+
};
28+
}, () => void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
29+
init: (countup: CountUp) => void;
30+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
31+
endVal: {
32+
type: import("vue").PropType<string | number>;
33+
required: true;
34+
};
35+
startVal: {
36+
type: import("vue").PropType<string | number>;
37+
} & {
38+
default: number;
39+
};
40+
duration: {
41+
type: import("vue").PropType<string | number>;
42+
} & {
43+
default: number;
44+
};
45+
autoplay: {
46+
type: import("vue").PropType<boolean>;
47+
} & {
48+
default: boolean;
49+
};
50+
options: {
51+
type: import("vue").PropType<CountUpOptions>;
52+
} & {
53+
default: undefined;
54+
};
55+
}>> & {
56+
onInit?: ((countup: CountUp) => any) | undefined;
57+
}, {
58+
options: CountUpOptions;
59+
duration: string | number;
60+
autoplay: boolean;
61+
startVal: string | number;
62+
}>;
63+
export default _default;

dist/vue-countup-v3.es.js

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
var __defProp = Object.defineProperty;
2+
var __defProps = Object.defineProperties;
3+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5+
var __hasOwnProp = Object.prototype.hasOwnProperty;
6+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
7+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8+
var __spreadValues = (a, b) => {
9+
for (var prop in b || (b = {}))
10+
if (__hasOwnProp.call(b, prop))
11+
__defNormalProp(a, prop, b[prop]);
12+
if (__getOwnPropSymbols)
13+
for (var prop of __getOwnPropSymbols(b)) {
14+
if (__propIsEnum.call(b, prop))
15+
__defNormalProp(a, prop, b[prop]);
16+
}
17+
return a;
18+
};
19+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20+
import { defineComponent, ref, watch, onMounted, openBlock, createElementBlock } from "vue";
21+
import { CountUp } from "countup.js";
22+
const __default__ = {
23+
name: "CountUp"
24+
};
25+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
26+
props: {
27+
endVal: null,
28+
startVal: { default: 0 },
29+
duration: { default: 2.5 },
30+
autoplay: { type: Boolean, default: true },
31+
options: { default: void 0 }
32+
},
33+
emits: ["init"],
34+
setup(__props, { emit: emits }) {
35+
const props = __props;
36+
let ElRef = ref();
37+
let countUp = ref();
38+
const startAnim = () => {
39+
var _a;
40+
(_a = countUp.value) == null ? void 0 : _a.start();
41+
};
42+
const initCountUp = () => {
43+
if (!ElRef.value)
44+
return;
45+
const startVal = Number(props.startVal);
46+
const endVal = Number(props.endVal);
47+
const duration = Number(props.duration);
48+
countUp.value = new CountUp(ElRef.value, endVal, __spreadValues({
49+
startVal,
50+
duration
51+
}, props.options));
52+
if (countUp.value.error) {
53+
console.error(countUp.value.error);
54+
return;
55+
}
56+
emits("init", countUp.value);
57+
};
58+
watch(() => props.endVal, (value) => {
59+
var _a;
60+
if (props.autoplay) {
61+
(_a = countUp.value) == null ? void 0 : _a.update(value);
62+
}
63+
});
64+
onMounted(() => {
65+
initCountUp();
66+
if (props.autoplay) {
67+
startAnim();
68+
}
69+
});
70+
return (_ctx, _cache) => {
71+
return openBlock(), createElementBlock("div", {
72+
ref_key: "ElRef",
73+
ref: ElRef
74+
}, null, 512);
75+
};
76+
}
77+
}));
78+
export { _sfc_main as default };

dist/vue-countup-v3.umd.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)