FoundKey/packages/client/src/directives/ripple.ts
Johann150 5b4c0ffdf3
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
client: fix some lints
Mostly focused on "@typescript-eslint/no-unused-vars" but also fixed some
other lints along the way.
2022-08-12 08:35:22 +02:00

19 lines
447 B
TypeScript

import Ripple from '@/components/ripple.vue';
import { popup } from '@/os';
export default {
mounted(el, binding) {
// 明示的に false であればバインドしない
if (binding.value === false) return;
el.addEventListener('click', () => {
const rect = el.getBoundingClientRect();
const x = rect.left + (el.offsetWidth / 2);
const y = rect.top + (el.offsetHeight / 2);
popup(Ripple, { x, y }, {}, 'end');
});
},
};