Permalink
Browse files

feat(table): Allow custom attributes in table td cell (#1193)

  • Loading branch information...
jon-walton authored and tmorehouse committed Oct 12, 2017
1 parent 69ed057 commit 485adbfdf218a7bb996f9999079d4569b3acc8ba
Showing with 4 additions and 1 deletion.
  1. +1 −0 docs/components/table/README.md
  2. +3 −1 lib/components/table.vue
@@ -256,6 +256,7 @@ The following field properties are recognized:
| `thClass` | String or Array | Class name (or array of class names) to add to header/footer `<th>` cell
| `thStyle` | Object | JavaScript object representing CSS styles you would like to apply to the table field `<th>`
| `variant` | String | Apply contextual class to the `<th>` **and** `<td>` in the column - `active`, `success`, `info`, `warning`, `danger` (these variants map to classes `thead-${variant}`, `table-${variant}`, or `bg-${variant}` accordingly)
| `tdAttr` | Object | JavaScript object representing additional attributes to apply to the `td` cell
**Notes:**
- _Field properties, if not present, default to `null` unless otherwise stated above._
@@ -73,7 +73,8 @@
<template v-for="field in computedFields">
<td v-if="$scopedSlots[field.key]"
:class="tdClasses(field, item)"
:key="field.key">
:key="field.key"
v-bind="field.tdAttr">
<slot :name="field.key"
:value="getFormattedValue(item, field)"
:unformatted="item[field.key]"
@@ -85,6 +86,7 @@
:class="tdClasses(field, item)"
:key="field.key"
v-html="getFormattedValue(item, field)"
v-bind="field.tdAttr"
></td>
</template>
</tr>

0 comments on commit 485adbf

Please sign in to comment.