Skip to content

Commit

Permalink
update table
Browse files Browse the repository at this point in the history
  • Loading branch information
xyhp915 committed Mar 7, 2018
1 parent fa0b0c1 commit 606316c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/docs/pkgs/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
export default {
data () {
return {
tableCols: ['__select|全选', 'first|第一列', 'second'],
tableCols: ['__select|全选', 'first|第一列|20', 'second'],
tableRows: [
{
first: 'a',
Expand Down Expand Up @@ -91,7 +91,7 @@

Name | Description | Type | Values | Default
---- | -------------- | -------- | ------ | -------
columns | 列元数据,以`__`开头的key为内置插件(目前支持 : `__select`) | Array | [`"key_ref|[key_alias]"`] | `[]`
columns | 列元数据,以`__`开头的key为内置插件(目前支持 : `__select`) | Array | [`"key_ref|[key_alias]|[col_with]"`] | `[]`
rows | 行数据集, 实体`key`必须对应列元数据 | Array | / | `[]`
bordered | 是否边框 | Boolean | / | /
striped | 🐴  斑马线 | Boolean | / | /
Expand All @@ -117,7 +117,7 @@ order-by-column | 排序 | [`sortableState`, `col`]
export default {
data () {
return {
tableCols: ['__select|全选', 'first|第一列', 'second'],
tableCols: ['__select|全选', 'first|第一列|20', 'second'],
tableRows: [
{
first: 'a',
Expand Down
9 changes: 8 additions & 1 deletion packages/table/impl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<tr>
<th v-for="cc in thColumns"
@click="_headClick(cc[0], $event)"
v-bind="cc[2]"
>

<slot v-if="`${cc[0].indexOf('__')}` == -1"
Expand Down Expand Up @@ -200,7 +201,13 @@
let tmp = null
if (it && !!~it.indexOf('|')) {
tmp = it.split('|')
tmp = [tmp[0].trim().toLowerCase(), tmp[1].trim()]
// extra attrs
const attrs = {}
if (tmp[2] && /^\d+$/.test(tmp[2])) {
attrs.width = `${tmp[2]}%`
}
tmp = [tmp[0].trim().toLowerCase(), tmp[1].trim(), attrs] // index[[2]] for with of percent
this.tdColumns.push(tmp[0])
this.thColumns.push(tmp)
} else {
Expand Down
1 change: 1 addition & 0 deletions scss/components/message/_message.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ $message-popup-body-padding: 0.5em 1em !default;
}

.#{$ns}-message-popup {
box-sizing: $box-sizing;
position: fixed;
top: $message-popup-top;
//left: 50%;
Expand Down

0 comments on commit 606316c

Please sign in to comment.