Skip to content
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

Open
OrdinarySF opened this issue Aug 31, 2023 · 5 comments

Comments

@OrdinarySF
Copy link

OrdinarySF commented Aug 31, 2023

Description

RT. Vue3

Steps to check or reproduce

<masonry-infinite-grid :column='2' :gap='10' align='start' @render-complete='renderComplete'>
      ...
    </masonry-infinite-grid>
@OrdinarySF
Copy link
Author

Same issue is that need all impleement emit function?

emit 된 모든 function 을 구현해야 하나요? 지속적으로 경고가 표시됩니다.

In fact, this will not make the warning.

@WebDev2030
Copy link

Same problem. How to resolve it?

@OrdinarySF
Copy link
Author

Same problem. How to resolve it?

ignore😂

@quninnd
Copy link

quninnd commented Jan 6, 2024

image

@swurtheone
Copy link

<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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants