feat: withInstall (#275)

This commit is contained in:
一万
2022-05-19 12:31:42 +08:00
committed by GitHub
parent b6ed8b40d1
commit 1f8e50f482
12 changed files with 34 additions and 81 deletions

View File

@@ -1,19 +1,11 @@
import { App } from "vue";
import { withInstall } from "/@/utils";
import reNormalCountTo from "./src/normal";
import reboundCountTo from "./src/rebound";
/** 普通数字动画组件 */
const ReNormalCountTo = Object.assign(reNormalCountTo, {
install(app: App) {
app.component(reNormalCountTo.name, reNormalCountTo);
}
});
const ReNormalCountTo = withInstall(reNormalCountTo);
/** 回弹式数字动画组件 */
const ReboundCountTo = Object.assign(reboundCountTo, {
install(app: App) {
app.component(reboundCountTo.name, reboundCountTo);
}
});
const ReboundCountTo = withInstall(reboundCountTo);
export { ReNormalCountTo, ReboundCountTo };