vuetable-2
Advanced tools
Comparing version 1.1.1 to 1.2.0
{ | ||
"name": "vuetable-2", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "A Vue.js 2.0 component for data table", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -19,1 +19,18 @@ [![npm](https://img.shields.io/npm/v/vuetable-2.svg)](https://www.npmjs.com/package/vuetable-2) | ||
Original version works great but wanted to be able to define action buttons per instance of a data table without depending on a globally defined component. I did this by adding a slot in place of the component that was used in the vuetable.vue. | ||
Use scoped slot in parent when defining the actions [Vue Doc for scopped Slots](https://vuejs.org/v2/guide/components.html#Scoped-Slots) | ||
e.g. | ||
```html | ||
<template slot="actions" scope="props"> | ||
<div class="table-button-container"> | ||
<button class="btn btn-default" @click="onClick('edit-item', props.rowData)"><i class="fa fa-edit"></i> View</button> | ||
<button class="btn btn-danger" @click="onClick('delete-item', props.rowData)"><i class="fa fa-remove"></i> Edit</button> | ||
</div> | ||
</template> | ||
``` | ||
the onClick function can now be defined in the parent and the parent has Access to rowData and rowIndex via props. :) | ||
The original functionality still works |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
271290
40
35