Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Commit 92c1791

Browse files
author
Ken Berkeley
committed
v1.1.0 Released!
1 parent faf8a07 commit 92c1791

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3835
-269
lines changed

docs/_book/en/DIY.html

Lines changed: 437 additions & 0 deletions
Large diffs are not rendered by default.

docs/_book/en/detailed/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# § Detailed
2+
3+
It would be better for you to understand the structure of this Datatable before the detailed content.
4+
5+
The source tree [`lib/`](https://github.com/OneWayTech/vue2-datatable/tree/master/lib) shown as below:
6+
7+
```
8+
lib/
9+
├─ HeaderSettings/
10+
│   ├─ ColumnGroup.vue
11+
│   └─ index.vue
12+
├─ HeadSort.vue
13+
├─ LimitSelect.vue
14+
├─ MultiSelect.vue
15+
├─ Pagination.vue
16+
└─ index.vue
17+
```
18+
19+
Let's look at the structure of the advanced example (source - [`examples/src/Advanced/index.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/examples/src/Advanced/index.vue), demo - [examples#advanced](https://OneWayTech.github.io/vue2-datatable/examples/dist#advanced))
20+
21+
<a href="images/structure.png" target="_blank">
22+
<img src="images/structure.png" alt="Structure">
23+
</a>

docs/_book/en/detailed/datatable-props.html

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
<a href="./">
147147

148148

149-
Detailed
149+
Detailed (click me)
150150

151151
</a>
152152

@@ -251,7 +251,33 @@
251251

252252
</li>
253253

254-
<li class="chapter " data-level="1.6" >
254+
<li class="chapter " data-level="1.6" data-path="../i18n.html">
255+
256+
<a href="../i18n.html">
257+
258+
259+
I18N
260+
261+
</a>
262+
263+
264+
265+
</li>
266+
267+
<li class="chapter " data-level="1.7" data-path="../DIY.html">
268+
269+
<a href="../DIY.html">
270+
271+
272+
DIY
273+
274+
</a>
275+
276+
277+
278+
</li>
279+
280+
<li class="chapter " data-level="1.8" >
255281

256282
<a target="_blank" href="https://github.com/OneWayTech/vue2-datatable/issues">
257283

@@ -264,7 +290,7 @@
264290

265291
</li>
266292

267-
<li class="chapter " data-level="1.7" >
293+
<li class="chapter " data-level="1.9" >
268294

269295
<a target="_blank" href="https://github.com/OneWayTech/vue2-datatable/releases">
270296

@@ -417,9 +443,9 @@ <h1 id="&#xA7;-props-of-datatable">&#xA7; <code>props</code> of Datatable</h1>
417443
</tr>
418444
<tr>
419445
<td>support-nested</td>
420-
<td>Should support nested components</td>
421-
<td>Boolean</td>
422-
<td>true / false</td>
446+
<td>Should support nested components (<code>accordion</code> mode is supported)</td>
447+
<td>Boolean / String</td>
448+
<td>true / false / &apos;accordion&apos;</td>
423449
<td>false</td>
424450
<td>N</td>
425451
</tr>
@@ -473,7 +499,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
473499

474500

475501

476-
<a href="./" class="navigation navigation-prev " aria-label="Previous page: Detailed">
502+
<a href="./" class="navigation navigation-prev " aria-label="Previous page: Detailed (click me)">
477503
<i class="fa fa-angle-left"></i>
478504
</a>
479505

@@ -489,7 +515,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
489515
<script>
490516
var gitbook = gitbook || [];
491517
gitbook.push(function() {
492-
gitbook.page.hasChanged({"page":{"title":"props of Datatable","level":"1.5.1","depth":2,"next":{"title":":columns","level":"1.5.2","depth":2,"path":"detailed/props-columns.md","ref":"detailed/props-columns.md","articles":[]},"previous":{"title":"Detailed","level":"1.5","depth":1,"path":"detailed/README.md","ref":"detailed/README.md","articles":[{"title":"props of Datatable","level":"1.5.1","depth":2,"path":"detailed/datatable-props.md","ref":"detailed/datatable-props.md","articles":[]},{"title":":columns","level":"1.5.2","depth":2,"path":"detailed/props-columns.md","ref":"detailed/props-columns.md","articles":[]},{"title":":data","level":"1.5.3","depth":2,"path":"detailed/props-data.md","ref":"detailed/props-data.md","articles":[]},{"title":":query","level":"1.5.4","depth":2,"path":"detailed/props-query.md","ref":"detailed/props-query.md","articles":[]},{"title":":selection","level":"1.5.5","depth":2,"path":"detailed/props-selection.md","ref":"detailed/props-selection.md","articles":[]},{"title":":xprops","level":"1.5.6","depth":2,"path":"detailed/props-xprops.md","ref":"detailed/props-xprops.md","articles":[]},{"title":"Dynamic Components","level":"1.5.7","depth":2,"path":"detailed/dynamic-comps.md","ref":"detailed/dynamic-comps.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["edit-link","github","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"edit-link":{"label":{"zh-cn":"编辑此页面","en":"Edit this page"},"base":"https://github.com/OneWayTech/vue2-datatable/edit/master/docs"},"github":{"url":"https://github.com/OneWayTech/vue2-datatable"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"language":"en","gitbook":"*"},"file":{"path":"detailed/datatable-props.md","mtime":"2017-06-07T16:02:08.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-06-07T16:17:41.560Z"},"basePath":"..","book":{"language":"en"}});
518+
gitbook.page.hasChanged({"page":{"title":"props of Datatable","level":"1.5.1","depth":2,"next":{"title":":columns","level":"1.5.2","depth":2,"path":"detailed/props-columns.md","ref":"detailed/props-columns.md","articles":[]},"previous":{"title":"Detailed (click me)","level":"1.5","depth":1,"path":"detailed/README.md","ref":"detailed/README.md","articles":[{"title":"props of Datatable","level":"1.5.1","depth":2,"path":"detailed/datatable-props.md","ref":"detailed/datatable-props.md","articles":[]},{"title":":columns","level":"1.5.2","depth":2,"path":"detailed/props-columns.md","ref":"detailed/props-columns.md","articles":[]},{"title":":data","level":"1.5.3","depth":2,"path":"detailed/props-data.md","ref":"detailed/props-data.md","articles":[]},{"title":":query","level":"1.5.4","depth":2,"path":"detailed/props-query.md","ref":"detailed/props-query.md","articles":[]},{"title":":selection","level":"1.5.5","depth":2,"path":"detailed/props-selection.md","ref":"detailed/props-selection.md","articles":[]},{"title":":xprops","level":"1.5.6","depth":2,"path":"detailed/props-xprops.md","ref":"detailed/props-xprops.md","articles":[]},{"title":"Dynamic Components","level":"1.5.7","depth":2,"path":"detailed/dynamic-comps.md","ref":"detailed/dynamic-comps.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["edit-link","github","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"edit-link":{"label":{"zh-cn":"编辑此页面","en":"Edit this page"},"base":"https://github.com/OneWayTech/vue2-datatable/edit/master/docs"},"github":{"url":"https://github.com/OneWayTech/vue2-datatable"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"language":"en","gitbook":"*"},"file":{"path":"detailed/datatable-props.md","mtime":"2017-07-12T08:25:28.882Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-07-12T10:19:54.330Z"},"basePath":"..","book":{"language":"en"}});
493519
});
494520
</script>
495521
</div>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# § `props` of Datatable
2+
3+
| prop | Desc | Type | Optional values | Default value | Required |
4+
|----------------|------------------------------------------------|---------|--------------|--------|----------|
5+
| columns | Defination of columns | Array | - | - | Y |
6+
| data | Table data of the current page (rows) | Array | - | - | Y |
7+
| total | Total number of records | Number | - | - | Y |
8+
| query | Query object | Object | - | - | Y |
9+
| selection | Container of multi-select | Array | - | - | N |
10+
| summary | Summary row | Object | - | - | N |
11+
| HeaderSettings | Should render HeaderSettings | Boolean | true / false | true | N |
12+
| Pagination | Should render pagination related | Boolean | true / false | true | N |
13+
| xprops | Container of extra props passed to dynamic components | Object | - | - | N |
14+
| support-backup | Should support backup of HeaderSettings | Boolean | true / false | false | N |
15+
| support-nested | Should support nested components (`accordion` mode is supported) | Boolean / String | true / false / 'accordion' | false | N |
16+
| table-bordered | Should add `.table-bordered` to `<table>` | Boolean | true / false | false | N |
17+
18+
> The above is based on the source ([`lib/index.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/lib/index.vue)).
19+
> By the way, the advanced example (source - [`examples/src/Advanced/index.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/examples/src/Advanced/index.vue), demo - [examples#advanced](https://OneWayTech.github.io/vue2-datatable/examples/dist#advanced))
20+
> almost covers all the usages, which is highly recommended to study and imitate.
21+
22+
In the following content, I would like to emphasize the props below:
23+
24+
* `columns`
25+
* `data`
26+
* `query`
27+
* `selection`
28+
* `summary`
29+
* `xprops`
30+
* Dynamic components(`thComp / tdComp / nested component`

docs/_book/en/detailed/dynamic-comps.html

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
<link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
5858

5959

60+
<link rel="next" href="../i18n.html" />
61+
6062

6163
<link rel="prev" href="props-xprops.html" />
6264

@@ -144,7 +146,7 @@
144146
<a href="./">
145147

146148

147-
Detailed
149+
Detailed (click me)
148150

149151
</a>
150152

@@ -249,7 +251,33 @@
249251

250252
</li>
251253

252-
<li class="chapter " data-level="1.6" >
254+
<li class="chapter " data-level="1.6" data-path="../i18n.html">
255+
256+
<a href="../i18n.html">
257+
258+
259+
I18N
260+
261+
</a>
262+
263+
264+
265+
</li>
266+
267+
<li class="chapter " data-level="1.7" data-path="../DIY.html">
268+
269+
<a href="../DIY.html">
270+
271+
272+
DIY
273+
274+
</a>
275+
276+
277+
278+
</li>
279+
280+
<li class="chapter " data-level="1.8" >
253281

254282
<a target="_blank" href="https://github.com/OneWayTech/vue2-datatable/issues">
255283

@@ -262,7 +290,7 @@
262290

263291
</li>
264292

265-
<li class="chapter " data-level="1.7" >
293+
<li class="chapter " data-level="1.9" >
266294

267295
<a target="_blank" href="https://github.com/OneWayTech/vue2-datatable/releases">
268296

@@ -477,19 +505,23 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
477505

478506

479507

480-
<a href="props-xprops.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: :xprops">
508+
<a href="props-xprops.html" class="navigation navigation-prev " aria-label="Previous page: :xprops">
481509
<i class="fa fa-angle-left"></i>
482510
</a>
483511

484512

513+
<a href="../i18n.html" class="navigation navigation-next " aria-label="Next page: I18N">
514+
<i class="fa fa-angle-right"></i>
515+
</a>
516+
485517

486518

487519
</div>
488520

489521
<script>
490522
var gitbook = gitbook || [];
491523
gitbook.push(function() {
492-
gitbook.page.hasChanged({"page":{"title":"Dynamic Components","level":"1.5.7","depth":2,"next":{"title":"Q & A (issues)","level":"1.6","depth":1,"url":"https://github.com/OneWayTech/vue2-datatable/issues","ref":"https://github.com/OneWayTech/vue2-datatable/issues","articles":[]},"previous":{"title":":xprops","level":"1.5.6","depth":2,"path":"detailed/props-xprops.md","ref":"detailed/props-xprops.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"edit-link":{"label":{"zh-cn":"编辑此页面","en":"Edit this page"},"base":"https://github.com/OneWayTech/vue2-datatable/edit/master/docs"},"github":{"url":"https://github.com/OneWayTech/vue2-datatable"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"language":"en","gitbook":"*"},"file":{"path":"detailed/dynamic-comps.md","mtime":"2017-06-07T16:02:08.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-06-07T16:17:41.560Z"},"basePath":"..","book":{"language":"en"}});
524+
gitbook.page.hasChanged({"page":{"title":"Dynamic Components","level":"1.5.7","depth":2,"next":{"title":"I18N","level":"1.6","depth":1,"path":"i18n.md","ref":"i18n.md","articles":[]},"previous":{"title":":xprops","level":"1.5.6","depth":2,"path":"detailed/props-xprops.md","ref":"detailed/props-xprops.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","github","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"edit-link":{"label":{"zh-cn":"编辑此页面","en":"Edit this page"},"base":"https://github.com/OneWayTech/vue2-datatable/edit/master/docs"},"github":{"url":"https://github.com/OneWayTech/vue2-datatable"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"language":"en","gitbook":"*"},"file":{"path":"detailed/dynamic-comps.md","mtime":"2017-06-06T12:09:21.009Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-07-12T10:19:54.330Z"},"basePath":"..","book":{"language":"en"}});
493525
});
494526
</script>
495527
</div>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# § Dynamic Components(`thComp / tdComp / nested component`
2+
3+
> The following code is excerpted from the source [`lib/index.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/lib/index.vue)
4+
5+
## `thComp`
6+
7+
```html
8+
<!-- table head component (thComp) -->
9+
<component v-if="column.thComp"
10+
:is="comp[column.thComp]"
11+
:column="column"
12+
:field="column.field"
13+
:title="column.title"
14+
v-bind="$props">
15+
</component>
16+
```
17+
18+
| prop | Desc | Type |
19+
|-----------|------------------------|--------------------|
20+
| column | Defination of column | Object |
21+
| field | Field name | String / undefined |
22+
| title | Displayed title | String / undefined |
23+
| `...$props` | all the `props` from Datatable | (Spread) |
24+
25+
## `tdComp`
26+
27+
```html
28+
<!-- table body component (tdComp) -->
29+
<component v-if="column.tdComp"
30+
:is="comp[column.tdComp]"
31+
:row="item"
32+
:field="column.field"
33+
:value="item[column.field]"
34+
:nested="item.__nested__"
35+
v-bind="$props">
36+
</component>
37+
```
38+
39+
| prop | Desc | Type |
40+
|-----------|------------------------|--------------------|
41+
| row | Current row | Object |
42+
| field | Field name | String / undefined |
43+
| value | Value | Any |
44+
| nested | Controller of the related nested component(reference to `row.__nested__`| Object / undefined |
45+
| `...$props` | all the `props` from Datatable | (Spread) |
46+
47+
## `nested component`
48+
49+
```html
50+
<!-- nested component -->
51+
<component
52+
:is="comp[item.__nested__.comp]"
53+
:row="item"
54+
:nested="item.__nested__"
55+
v-bind="$props">
56+
</component>
57+
```
58+
59+
| prop | Desc | Type |
60+
|-----------|------------------------|--------------------|
61+
| row | Current row | Object |
62+
| nested | Controller of the related nested component(reference to `row.__nested__`| Object / undefined |
63+
| `...$props` | all the `props` from Datatable | (Spread) |
64+
65+
> [`comps/`](https://github.com/OneWayTech/vue2-datatable/blob/master/examples/src/Advanced/comps) of the advanced example covers all the use cases, which is highly recommended to study and imitate.
-95.2 KB
Loading

0 commit comments

Comments
 (0)