vue-rewards
Version:
Vue-rewards lets you add micro-interactions to your app, and rewards users with the rain of confetti, emoji or balloons in seconds.
26 lines (20 loc) • 553 B
text/typescript
import { useReward } from "./composables/confetti.ts";
export default {
install: (app, options) => {
// app.directive("reward", (el, binding) => {
// // get id from el
// let options = binding.value;
// if(!options) {
// options = {}
// }
// let type = binding.arg;
// if(!type) {
// type = "confetti"
// }
// const { reward } = useReward(el, type, options);
// reward();
// });
app.config.globalProperties.$reward = useReward;
},
};
export { useReward };