nhn / tui.grid

🍞🔡 The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
http://ui.toast.com/tui-grid/
MIT License
2.41k stars 388 forks source link

Problem with 2 or more grids in Vue.js #1921

Open shhong94 opened 1 year ago

shhong94 commented 1 year ago

Summary

Screenshots 1 This is original page with 2 grids.

2 After repeating enter other page / return original page, positioning, data, columns of grids turn into chaotic. Besides, several features of grid (drag, checkbox... etc) are not working.

I think because my project is running as Single Page Application with Vue router, so the data of grids are mixing in background.

I cannot find any references associated with this problem. What should i do?

Source Code

<template>
    <grid :data="gridProps.data" :columns="gridProps.columns" />
    <grid :data="gridProps2.data" :columns="gridProps2.columns" />
</template>

<script>
import 'tui-grid/dist/tui-grid.css';
import { Grid } from '@toast-ui/vue-grid';
...
components: {
    grid: Grid,
  },
data() {
      gridProps: {
        data: [ // for rowData prop
          {
            11111: '11111',
            22222: '22222',
            33333: '33333',
          },
          {
            11111: '11111',
            22222: '22222',
            33333: '33333',
          },
          {
            11111: '11111',
            22222: '22222',
            33333: '33333',
          },
        ],
        columns: [ // for columnData prop
          {
            header: '11111',
            name: '11111',
          },
          {
            header: '22222',
            name: '22222',
          },
          {
            header: '33333',
            name: '33333',
          },
        ],
      },
      gridProps2: {
        data: [ // for rowData prop
          {
            A: 'A',
            B: 'B',
          },
          {
            A: 'A',
            B: 'B',
          },
        ],
        columns: [ // for columnData prop
          {
            header: 'A',
            name: 'A',
          },
          {
            header: 'B',
            name: 'B',
          },
        ],
      },
}
...
</script>

Version vue: 2.5.2 vue-router: 3.0.1 @toast-ui/vue-grid: 4.21.9