Skip to content
This repository has been archived by the owner on Oct 24, 2019. It is now read-only.

v2.0.0

Compare
Choose a tag to compare
@jung-han jung-han released this 04 Jul 07:04
· 8 commits to master since this release

New Vue Wrapper For TOAST UI Grid 4.0 πŸŽ‰πŸŽ‰πŸŽ‰

Breaking Changes

prop name change

  • rowData -> data
  • columnData -> columns

TOAST UI Grid has its own reactivity system, and does not use the reactivity system of Vue. So, instead of adding props in the data, declare props in the created lifecycle method.

// v1.0.0
<template>
  <grid
    :rowData="data" 
    :columnData="columns" 
  />
</template>
<script>
import 'tui-grid/dist/tui-grid.css'
import { Grid } from '@toast-ui/vue-grid'

export default {
  components: {
    'grid': Grid
  },
  data() {
    return {
      data: [ // for rowData prop
        {
          name: 'Beautiful Lies',
          artist: 'Birdy'
        },
        {
          name: 'X',
          artist: 'Ed Sheeran'
        }
      ],
      columns: [ // for columnData prop
        {
          header: 'Name',
          name: 'name',
        },
        {
          header: 'Artist',
          name: 'artist'
        }
        ]
      }
    }
  }
}
</script>


// v2.0.0
<template>
  <grid
    :data="gridProps.data" 
    :columns="gridProps.columns" 
  />
</template>
<script>
import 'tui-grid/dist/tui-grid.css'
import { Grid } from '@toast-ui/vue-grid'

export default {
  components: {
    'grid': Grid
  },
  created() {
    this.gridProps = {
      data: [ // for rowData prop
        {
          name: 'Beautiful Lies',
          artist: 'Birdy'
        },
        {
          name: 'X',
          artist: 'Ed Sheeran'
        }
      ],
      columns: [ // for columnData prop
        {
          header: 'Name',
          name: 'name',
        },
        {
          header: 'Artist',
          name: 'artist'
        }
      ]
    }
  }
}
</script>

API Document