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

Commit cc7b3df

Browse files
author
jung-han
committed
Merge branch 'master' into production
2 parents 3a1b9bf + 89dbe1f commit cc7b3df

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props. Ex
136136

137137
| Type | Required |
138138
| --- | --- |
139-
| Array | O |
139+
| Array or Object | O |
140140

141141
These props are row and colume data of the grid. If you change `rowData` or `columnData`, the grid is rendered to change data.
142142

@@ -216,6 +216,16 @@ After then you can use methods through `this.$refs`. We provide `getRootElement`
216216
this.$refs.tuiGrid.invoke('setWidth', 500);
217217
```
218218

219+
## Static Methods
220+
The wrapper component does not provide a way to call [static methods of TOAST UI Grid](http://nhn.github.io/tui.grid/latest/Grid#applyTheme). If you want to use static methods such as `applyTheme` or `setLanguage` you should use it via importing tui-grid directly.
221+
222+
```js
223+
import TuiGrid from 'tui-grid';
224+
225+
TuiGrid.setLanguage('ko');
226+
TuiGrid.applyTheme('striped');
227+
```
228+
219229
## 🔧 Pull Request Steps
220230

221231
TOAST UI products are open source, so you can create a pull request(PR) after you fix issues.

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ You can use `rowData`, `columnData`, `options`, `theme` and `language` props.
111111

112112
| Type | Required |
113113
| --- | --- |
114-
| Array | O |
114+
| Array | Object | O |
115115

116116
These props are row and colume data of the grid. If you change `rowData` or `columnData`, the grid is rendered to change data.
117117

example/App.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
:theme="gridProps.myTheme"
99
@check="onCheck"
1010
@uncheck="onUnCheck"
11+
:rowHeaders="gridProps.rowHeaders"
12+
:columnOptions="gridProps.columnOptions"
1113
></grid>
1214
</div>
1315
</template>
@@ -21,6 +23,11 @@ export default {
2123
},
2224
created() {
2325
this.gridProps = {
26+
rowHeaders: ['checkbox', 'rowNum'],
27+
columnOptions: {
28+
resizable: true,
29+
frozenCount: 1
30+
},
2431
columns: [
2532
{
2633
header: 'Name',

src/Grid.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default {
1212
name: 'TuiGrid',
1313
props: {
1414
data: {
15-
type: Array,
15+
type: [Array, Object],
1616
required: true
1717
},
1818
columns: {
@@ -25,6 +25,7 @@ export default {
2525
return {};
2626
}
2727
},
28+
// @deprecated. You should use it via importing tui-grid directly.
2829
theme: {
2930
type: [String, Object],
3031
validator(value) {
@@ -38,6 +39,7 @@ export default {
3839
return result;
3940
}
4041
},
42+
// @deprecated. You should use it via importing tui-grid directly.
4143
language: {
4244
type: [String, Object],
4345
validator(value) {
@@ -53,11 +55,12 @@ export default {
5355
}
5456
},
5557
mounted() {
56-
const options = Object.assign({}, this.options, {
58+
const options = Object.assign(this.options || {}, this.$attrs, {
5759
el: this.$refs.tuiGrid,
5860
data: this.data,
5961
columns: this.columns
6062
});
63+
6164
this.gridInstance = new Grid(options);
6265
this.addEventListeners();
6366
this.applyTheme();
@@ -76,6 +79,7 @@ export default {
7679
this.gridInstance.on(eventName, (...args) => this.$emit(eventName, ...args));
7780
}
7881
},
82+
// @deprecated. You should use it via importing tui-grid directly.
7983
applyTheme() {
8084
if (this.theme) {
8185
if (typeof this.theme === 'string') {
@@ -85,6 +89,7 @@ export default {
8589
}
8690
}
8791
},
92+
// @deprecated. You should use it via importing tui-grid directly.
8893
setLanguage() {
8994
if (this.language) {
9095
if (typeof this.language === 'string') {

0 commit comments

Comments
 (0)