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.
23 lines (19 loc) • 527 B
text/typescript
import { useReward } from "../composables/confetti";
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;
},
};