client: refactor components/ripple.vue to composition API

This commit is contained in:
Johann150 2022-09-30 17:57:06 +02:00
parent f571f61c2d
commit be19ea610f
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -56,28 +56,23 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts" setup>
import { defineComponent, onMounted } from 'vue'; import { onMounted } from 'vue';
import * as os from '@/os'; import * as os from '@/os';
export default defineComponent({ const props = withDefaults(defineProps<{
props: { x: number;
x: { y: number;
type: Number, particle?: boolean;
required: true, }>(), {
}, particle: true,
y: { });
type: Number,
required: true, const emit = defineEmits<{
}, (ev: 'end'): void;
particle: { }>();
type: Boolean,
required: false, const zIndex = os.claimZIndex('high');
default: true,
},
},
emits: ['end'],
setup(props, context) {
const particles = []; const particles = [];
const origin = 64; const origin = 64;
const colors = ['#FF1493', '#00FFFF', '#FFE202']; const colors = ['#FF1493', '#00FFFF', '#FFE202'];
@ -100,16 +95,9 @@ export default defineComponent({
onMounted(() => { onMounted(() => {
window.setTimeout(() => { window.setTimeout(() => {
context.emit('end'); emit('end');
}, 1100); }, 1100);
}); });
return {
particles,
zIndex: os.claimZIndex('high'),
};
},
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>