Skip to content

Commit

Permalink
support search box placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
njleonzhang committed Mar 7, 2017
1 parent 4887d94 commit 0d41ec8
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 10 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<td>-</td>
</tr>
<tr>
<td rowspan="5"></td>
<td rowspan="6"></td>
<td>show</td>
<td></td>
<td>show or hide search box</td>
Expand Down Expand Up @@ -217,6 +217,13 @@
<td>Function</td>
<td>-</td>
</tr>
<tr>
<td>placeholder</td>
<td></td>
<td>searchbox placeholder</td>
<td>String</td>
<td>""</td>
</tr>
<tr>
<td>row-action-def</td>
<td></td>
Expand Down
1 change: 1 addition & 0 deletions example/docs/cn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export default {
getSearchDef() {
return {
offset: 12,
placeholder: 'please input searchkey',
props: ['state', 'flow_type'] // can be string or Array
}
},
Expand Down
1 change: 1 addition & 0 deletions example/docs/en.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ export default {
getSearchDef() {
return {
offset: 12,
placeholder: 'please input searchkey',
props: ['state', 'flow_type'] // can be string or Array
}
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-data-tables",
"version": "1.0.6",
"version": "1.0.7",
"description": "vue2.0 DataTables, based on element-ui, el-table + el-pagination + custom filter and sort",
"author": "njleonzhang <[email protected]>",
"main": "dist/data-tables.js",
Expand Down Expand Up @@ -36,7 +36,7 @@
"chalk": "^1.1.3",
"connect-history-api-fallback": "^1.1.0",
"css-loader": "^0.25.0",
"element-ui": "^1.1.5",
"element-ui": "^1.2.3",
"eslint": "^3.7.1",
"eslint-config-standard": "^6.1.0",
"eslint-friendly-formatter": "^2.0.5",
Expand Down
20 changes: 14 additions & 6 deletions readme_table_backup.pug
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ table
td -

tr
td(rowspan='5')
td(rowspan='6')
td show
td
td show or hide search box
Expand Down Expand Up @@ -149,6 +149,13 @@ table
td Function
td -

tr
td placeholder
td
td searchbox placeholder
td String
td ""

tr
td row-action-def
td
Expand Down Expand Up @@ -209,36 +216,37 @@ table
td
td define pagination.
td Object
td
td -

tr
td(rowspan='4')
td layout
td
td
td refer to
a(href='http://element.eleme.io/#/zh-CN/component/pagination') Elmeme Doc
td String
td [prev, pager, next, jumper, sizes, total]

tr
td pageSize
td
td refer to
td refer to
a(href='http://element.eleme.io/#/zh-CN/component/pagination') Elmeme Doc
td Number
td 20

tr
td pageSizes
td
td refer to
td refer to
a(href='http://element.eleme.io/#/zh-CN/component/pagination') Elmeme Doc
td Array
td [20, 50, 100]

tr
td currentPage
td
td refer to
td refer to
a(href='http://element.eleme.io/#/zh-CN/component/pagination') Elmeme Doc
td Number
td 1
6 changes: 5 additions & 1 deletion src/components/DataTables.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@
:span='innerSearchDef.width',
:offset='innerSearchDef.offset',
v-if='searchShow')
el-input(v-model='searchKey', icon='search')
el-input(
v-model='searchKey',
:placeholder='innerSearchDef.placeholder',
icon='search')

el-table(
:data='curTableData',
Expand Down Expand Up @@ -175,6 +178,7 @@ export default {
props: undefined,
filterFunction: undefined,
width: 5,
placeholder: '',
offset: 0
}, this.searchDef)
},
Expand Down

0 comments on commit 0d41ec8

Please sign in to comment.