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

Commit 9bb45d7

Browse files
author
jung-han
committed
chore: apply review - 1
1 parent 458c9a6 commit 9bb45d7

File tree

6 files changed

+54
-47
lines changed

6 files changed

+54
-47
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Explain the problem and include additional details to help maintainers reproduce
1717
* **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem.
1818

1919
## Suggesting Enhancements
20-
In case you want to suggest for TOAST UI Editor, please follow this guideline to help maintainers and the community understand your suggestion.
20+
In case you want to suggest for TOAST UI Grid, please follow this guideline to help maintainers and the community understand your suggestion.
2121
Before creating suggestions, please check [issue list](https://github.com/nhn/toast-ui.vue-grid/labels/feature%20request) if there's already a request.
2222

2323
Create an issue and provide the following information:
2424

2525
* **Use a clear and descriptive title** for the issue to identify the suggestion.
2626
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
2727
* **Provide specific examples to demonstrate the steps.** Include copy/pasteable snippets which you use in those examples, as Markdown code blocks.
28-
* **Include screenshots and animated GIFs** which helps demonstrate the steps or point out the part of TOAST UI Editor which the suggestion is related to.
28+
* **Include screenshots and animated GIFs** which helps demonstrate the steps or point out the part of TOAST UI Grid which the suggestion is related to.
2929
* **Explain why this enhancement would be useful** to most TOAST UI users.
3030
* **List some other text editors or applications where this enhancement exists.**
3131

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ You can use Toast UI Grid for Vue as moudule format or namespace. Also you can u
8686
First insert `<grid>` in the template or html. `rowData` and `columnData` props are required.
8787

8888
```html
89-
<grid :rowData="options.rows" :columnData="options.columns" />
89+
<grid :data="gridProps.data" :columns="gridProps.columns" />
9090
```
9191

9292
Load grid component and then add it to the `components` in your component or Vue instance.
9393

94-
> Tui-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.
94+
> 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.
9595

9696
```js
9797
import 'tui-grid/dist/tui-grid.css'
@@ -102,8 +102,8 @@ export default {
102102
'grid': Grid
103103
},
104104
created() {
105-
this.options = {
106-
rows: [ // for rowData prop
105+
this.gridProps = {
106+
data: [ // for rowData prop
107107
{
108108
name: 'Beautiful Lies',
109109
artist: 'Birdy'
@@ -178,7 +178,7 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props. Ex
178178
* mouseout : Occurs when a mouse pointer is moved off from the Grid.
179179
* mousedown : Occurs when a mouse button is downed on the Grid.
180180
* focusChange : Occurs when focused cell is about to change.
181-
* expande : Occurs when the row having child rows is expanded.
181+
* expand : Occurs when the row having child rows is expanded.
182182
* collapse : Occurs when the row having child rows is collapsed.
183183
* beforeRequest : Occurs before the http request is sent.
184184
* response : Occurs when the response is received from the server.

docs/getting-started.md

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ You can use Toast UI Grid for Vue as module format or namespace. Also you can us
6161
First insert `<grid>` in the template or html. `rowData` and `columnData` props are required.
6262

6363
```html
64-
<grid :rowData="options.rows" :columnData="options.columns" />
64+
<grid :data="gridProps.data" :columns="gridProps.columns" />
6565
```
6666

6767
Load grid component and then add it to the `components` in your component or Vue instance.
6868

69-
> Tui-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.
69+
> 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.
7070

7171
```js
7272
import 'tui-grid/dist/tui-grid.css'
@@ -78,7 +78,7 @@ export default {
7878
},
7979
created() {
8080
this.options = {
81-
rows: [ // for rowData prop
81+
data: [ // for rowData prop
8282
{
8383
name: 'Beautiful Lies',
8484
artist: 'Birdy'
@@ -119,7 +119,10 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
119119

120120
``` html
121121
<template>
122-
<grid :rowData="rows" :columnData="columns" />
122+
<grid
123+
:data="gridProps.data"
124+
:columns="gridProps.columns"
125+
/>
123126
</template>
124127
<script>
125128
import 'tui-grid/dist/tui-grid.css'
@@ -131,8 +134,8 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
131134
'grid': Grid
132135
},
133136
created() {
134-
this.options = {
135-
rows: [ // for rowData prop
137+
this.gridProps = {
138+
data: [ // for rowData prop
136139
{
137140
name: 'Beautiful Lies',
138141
artist: 'Birdy'
@@ -171,9 +174,9 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
171174
``` html
172175
<template>
173176
<grid
174-
:rowData="options.rows"
175-
:columnData="options.columns"
176-
:options="options.options"
177+
:data="gridProps.data"
178+
:columns="gridProps.columns"
179+
:options="gridProps.options"
177180
/>
178181
</template>
179182
<script>
@@ -186,8 +189,8 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
186189
'grid': Grid
187190
},
188191
created() {
189-
this.options = {
190-
rows: [
192+
this.gridProps = {
193+
data: [
191194
// ... omit
192195
],
193196
columns: [
@@ -220,8 +223,8 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
220223
``` html
221224
<template>
222225
<grid
223-
:rowData="options.rows"
224-
:columnData="options.columns"
226+
:data="gridProps.data"
227+
:columns="gridProps.columns"
225228
:theme="'striped'"
226229
/>
227230
</template>
@@ -235,7 +238,7 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
235238
'grid': Grid
236239
},
237240
created() {
238-
this.options = {
241+
this.gridProps = {
239242
rows: [
240243
// ... omit
241244
],
@@ -253,9 +256,9 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
253256
``` html
254257
<template>
255258
<grid
256-
:rowData="options.rows"
257-
:columnData="options.columns"
258-
:theme="options.myTheme"
259+
:data="gridProps.rows"
260+
:columns="gridProps.columns"
261+
:theme="gridProps.myTheme"
259262
/>
260263
</template>
261264
<script>
@@ -268,8 +271,8 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
268271
'grid': Grid
269272
},
270273
created() {
271-
this.options = {
272-
rows: [
274+
this.gridProps = {
275+
data: [
273276
// ... omit
274277
],
275278
columns: [
@@ -313,7 +316,11 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
313316

314317
```html
315318
<template>
316-
<grid :rowData="rows" :columnData="columns" :language="'ko'"/>
319+
<grid
320+
:data="rows"
321+
:columns="columns"
322+
:language="'ko'"
323+
/>
317324
</template>
318325
<script>
319326
import 'tui-grid/dist/tui-grid.css'
@@ -336,9 +343,9 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
336343
```html
337344
<template>
338345
<grid
339-
:rowData="options.rows"
340-
:columnData="options.columns"
341-
:language="options.myLang"
346+
:data="gridProps.data"
347+
:columns="gridProps.columns"
348+
:language="gridProps.myLang"
342349
/>
343350
</template>
344351
<script>
@@ -351,8 +358,8 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
351358
'grid': Grid
352359
},
353360
created() {
354-
this.options = {
355-
rows: [
361+
this.gridProps = {
362+
data: [
356363
// ... omit
357364
],
358365
columns: [
@@ -412,8 +419,8 @@ Example :
412419
```html
413420
<template>
414421
<grid
415-
:rowData="rows"
416-
:columnData="columns"
422+
:data="gridProps.data"
423+
:columns="gridProps.columns"
417424
@click="onClick"
418425
@check="onCheck"
419426
/>
@@ -428,8 +435,8 @@ export default {
428435
'grid': Grid
429436
},
430437
created() {
431-
this.options = {
432-
rows: [
438+
this.gridProps = {
439+
data: [
433440
// ... omit
434441
],
435442
columns: [
@@ -454,7 +461,7 @@ export default {
454461
For use method, first you need to assign `ref` attribute of element like this:
455462

456463
```html
457-
<grid ref="tuiGrid" :rowData="rows" :columnData="columns"/>
464+
<grid ref="tuiGrid" :data="rows" :columns="columns"/>
458465
```
459466

460467
After then you can use methods through `this.$refs`. We provide `getRootElement` and `invoke` methods.

example/App.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<div class="container">
33
<h1>🍞🔡 TOAST UI Grid + Vue</h1>
44
<grid
5-
:rowData="options.data"
6-
:columnData="options.columns"
7-
:options="options.options"
8-
:theme="options.myTheme"
5+
:data="gridProps.data"
6+
:columns="gridProps.columns"
7+
:options="gridProps.options"
8+
:theme="gridProps.myTheme"
99
@check="onCheck"
1010
@uncheck="onUnCheck"
1111
></grid>
@@ -20,7 +20,7 @@ export default {
2020
grid: Grid
2121
},
2222
created() {
23-
this.options = {
23+
this.gridProps = {
2424
columns: [
2525
{
2626
header: 'Name',
@@ -43,6 +43,7 @@ export default {
4343
copyOptions: {
4444
useListItemText: true
4545
},
46+
formatter: 'listItemText',
4647
editor: {
4748
type: 'radio',
4849
options: {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"main": "dist/toastui-vue-grid.js",
66
"files": [
77
"dist",
8-
"src",
98
"index.d.ts"
109
],
1110
"scripts": {

src/Grid.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ const presetLanguage = ['en', 'ko'];
3030
export default {
3131
name: 'TuiGrid',
3232
props: {
33-
rowData: {
33+
data: {
3434
type: Array,
3535
required: true
3636
},
37-
columnData: {
37+
columns: {
3838
type: Array,
3939
required: true
4040
},
@@ -79,8 +79,8 @@ export default {
7979
mounted() {
8080
const options = Object.assign({}, this.options, {
8181
el: this.$refs.tuiGrid,
82-
data: this.rowData,
83-
columns: this.columnData
82+
data: this.data,
83+
columns: this.columns
8484
});
8585
this.gridInstance = new Grid(options);
8686
this.addEventListeners();

0 commit comments

Comments
 (0)