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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
jungeun-cho committed Nov 28, 2018
2 parents ee78b82 + 1479b9a commit b4dbeed
Show file tree
Hide file tree
Showing 5 changed files with 12,071 additions and 4,101 deletions.
21 changes: 1 addition & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* [Collect statistics on the use of open source](#collect-statistics-on-the-use-of-open-source)
* [Install](#-install)
* [Using npm](#using-npm)
* [Via Contents Delivery Network (CDN)](#via-contents-delivery-network-cdn)
* [Usage](#-usage)
* [Load](#load)
* [Implement](#implement)
Expand Down Expand Up @@ -49,24 +48,6 @@ tui.usageStatistics = false;
npm install --save @toast-ui/vue-grid
```

### Via Contents Delivery Network (CDN)

TOAST UI products are available over the CDN powered by [TOAST Cloud](https://www.toast.com). When you load `toastui-vue-grid.js` using CDN, you should insert dependency modules `vue`, `tui-grid.js` and `tui-grid.css` in the html.

Also you should insert `jquery`, `underscore`, `backbone`, `tui-code-snippet`, `tui-pagination`, `tui-date-picker` that dependency modules of `tui-grid.js`. For more information about dependency of `tui-grid.js`, see [Download Files of Toast UI Grid](https://github.com/nhnent/tui.grid/blob/master/docs/getting-started.md#downloading-files)

```html
<script src="path/to/jquery"></script>
<script src="path/to/underscore"></script>
<script src="path/to/tui-code-snippet"></script>
<script src="path/to/tui-pagination"></script>
<script src="path/to/ui-date-picker"></script>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://uicdn.toast.com/tui-grid/latest/tui-grid.js"></script>
<script src="https://uicdn.toast.com/toast-ui.vue-grid/latest/toastui-vue-grid.js"></script>
<link rel="stylesheet" href="https://uicdn.toast.com/tui-grid/latest/tui-grid.css" />
```

## 🔡 Usage

### Load
Expand All @@ -85,7 +66,7 @@ You can use Toast UI Grid for Vue as moudule format or namespace. Also you can u
```js
require('tui-grid/dist/tui-grid.css');
var toastui = require('@toast-ui/vue-grid');
var Grid = toastui.Calendar;
var Grid = toastui.Grid;
```

* Using Single File Component
Expand Down
26 changes: 3 additions & 23 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## 🚩 Table of Contents
* [Install](#-install)
* [Using npm](#using-npm)
* [Via Contents Delivery Network (CDN)](#via-contents-delivery-network-cdn)
* [Usage](#-usage)
* [Load](#load)
* [Implement](#implement)
Expand All @@ -24,25 +23,6 @@
npm install --save @toast-ui/vue-grid
```

### Via Contents Delivery Network (CDN)

TOAST UI products are available over the CDN powered by [TOAST Cloud](https://www.toast.com). When you load `toastui-vue-grid.js` using CDN, you should insert dependency modules `vue`, `tui-grid.js` and `tui-grid.css` in the html.

Also you should insert `jquery`, `underscore`, `backbone`, `tui-code-snippet`, `tui-pagination`, `tui-date-picker` that dependency modules of `tui-grid`. For more information about dependency of `tui-grid`, see [Download Files of Toast UI Grid](https://github.com/nhnent/tui.grid/blob/master/docs/getting-started.md#downloading-files)

```html
<script src="path/to/jquery"></script>
<script src="path/to/underscore"></script>
<script src="path/to/backbone"></script>
<script src="path/to/tui-code-snippet"></script>
<script src="path/to/tui-pagination"></script>
<script src="path/to/tui-date-picker"></script>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://uicdn.toast.com/tui-grid/latest/tui-grid.js"></script>
<script src="https://uicdn.toast.com/toast-ui.vue-grid/latest/toastui-vue-grid.js"></script>
<link rel="stylesheet" href="https://uicdn.toast.com/tui-grid/latest/tui-grid.css" />
```

## 🔡 Usage

### Load
Expand All @@ -61,7 +41,7 @@ You can use Toast UI Grid for Vue as moudule format or namespace. Also you can u
```js
require('tui-grid/dist/tui-grid.css');
var toastui = require('@toast-ui/vue-grid');
var Grid = toastui.Calendar;
var Grid = toastui.Grid;
```

* Using Single File Component
Expand Down Expand Up @@ -487,10 +467,10 @@ export default {
}
},
methods: {
onClick(nativeEvent, targetType, rowKey, columnName, instance) {
onClick(evt) {
// implement your code
},
onCheck(rowKey, instance) {
onCheck(evt) {
// implement your code
}
}
Expand Down
144 changes: 144 additions & 0 deletions example/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<template>
<div class="container">
<h1>🍞🔡 TOAST UI Grid + Vue</h1>
<grid :rowData="data"
:columnData="columns"
:options="options"
@check="onCheck"
@uncheck="onUnCheck"
></grid>
</div>
</template>
<script>
import {Grid} from '../src/index.js';
export default {
components: {
'grid': Grid
},
data() {
return {
columns: [
{
title: 'Name',
name: 'name'
},
{
title: 'Artist',
name: 'artist'
},
{
title: 'Personal Score',
name: 'score',
onBeforeChange(ev) {
console.log('executes before the value changes : ', ev);
},
onAfterChange(ev) {
console.log('executes after the value has changed : ', ev);
},
copyOptions: {
useListItemText: true
},
editOptions: {
type: 'radio',
listItems: [
{
text: '★☆☆☆☆',
value: '1'
},
{
text: '★★☆☆☆',
value: '2'
},
{
text: '★★★☆☆',
value: '3'
},
{
text: '★★★★☆',
value: '4'
},
{
text: '★★★★★',
value: '5'
}
],
useViewMode: true
}
}
],
data: [
{
name: 'Kiss and Make Up',
artist: 'Dua Lipa',
score: '5'
},
{
name: 'Bohemian Rhapsody',
artist: 'Queen',
score: '2'
},
{
name: 'Done For Me',
artist: 'Charlie Puth',
score: '3'
},
{
name: 'thank u, next',
artist: 'Ariana Grande',
score: '4'
},
{
name: 'Handclap',
artist: 'Fitz & The Tantrums',
score: '1'
},
{
name: 'Shape Of You',
artist: 'Ed Sheeran',
score: '5'
},
{
name: 'Snowman',
artist: 'Sia',
score: '5'
},
{
name: 'Don\'t Stop Me Now ',
artist: 'Queen',
score: '3'
},
{
name: 'Havana',
artist: 'Camila Cabello',
score: '2'
},
{
name: 'A No No',
artist: 'Mariah Carey',
score: '5'
}
],
options: {
rowHeaders: [
{
type: 'checkbox'
}
]
}
};
},
methods: {
onCheck(ev) {
console.log('check event: ', ev);
},
onUnCheck(ev) {
console.log('uncheck event: ', ev);
}
}
};
</script>
<style>
@import 'https://uicdn.toast.com/tui-grid/latest/tui-grid.css';
</style>
Loading

0 comments on commit b4dbeed

Please sign in to comment.