egjs-infinitegrid icon indicating copy to clipboard operation
egjs-infinitegrid copied to clipboard

[Vue warn]: Component emitted event "request-append" but it is neither declared in the emits option nor as an "onRequest-append" prop.

Open OrdinarySF opened this issue 1 year ago • 5 comments

Description

RT. Vue3

Steps to check or reproduce

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

OrdinarySF avatar Aug 31 '23 03:08 OrdinarySF

Same issue is that need all impleement emit function?

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

In fact, this will not make the warning.

OrdinarySF avatar Sep 11 '23 09:09 OrdinarySF

Same problem. How to resolve it?

WebDev2030 avatar Dec 21 '23 08:12 WebDev2030

Same problem. How to resolve it?

ignore😂

OrdinarySF avatar Jan 03 '24 13:01 OrdinarySF

image

quninnd avatar Jan 06 '24 03:01 quninnd

<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>

swurtheone avatar Jul 22 '24 09:07 swurtheone