-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Vue warn]: Component emitted event "request-append" but it is neither declared in the emits option nor as an "onRequest-append" prop. #553
Comments
In fact, this will not make the warning. |
Same problem. How to resolve it? |
ignore😂 |
<template>
<div ref="gridContainer">
<slot></slot>
</div>
</template>
<script lang="ts">
import { defineComponent, onMounted, ref } from 'vue';
import VanillaInfiniteGrid, { MasonryInfiniteGrid } from '@egjs/infinitegrid';
export default defineComponent({
name: 'InfiniteGrid',
props: {
gap: {
type: Number,
default: 5,
},
},
emits: ['requestAppend', 'changeScroll', 'requestPrepend', 'renderComplete', 'contentError'],
setup(props, { emit }) {
const gridContainer = ref<HTMLElement | null>(null);
let grid: VanillaInfiniteGrid | null = null;
onMounted(() => {
if (gridContainer.value) {
grid = new MasonryInfiniteGrid(gridContainer.value, {
gap: props.gap,
});
grid.on('requestAppend', (e) => emit('requestAppend', e));
grid.on('changeScroll', (e) => emit('changeScroll', e));
grid.on('requestPrepend', (e) => emit('requestPrepend', e));
grid.on('renderComplete', (e) => emit('renderComplete', e));
grid.on('contentError', (e) => emit('contentError', e));
}
});
return {
gridContainer,
};
},
});
</script>
<style scoped>
/* Add your styles here */
</style>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
RT. Vue3
Steps to check or reproduce
The text was updated successfully, but these errors were encountered: