Skip to content

Commit

Permalink
improve example
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed Nov 5, 2018
1 parent 49c5238 commit d05230b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19930,6 +19930,10 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
},
fields: {
id: { label: 'ID', sortable: true },
actions: {
label: 'Actions',
defaultContent: '<a href="javascript:void(0);" data-action="edit" class="btn btn-primary btn-sm"><i class="mdi mdi-square-edit-outline"></i> Edit</a>' + '<span data-action="delete" class="btn btn-danger btn-sm"><i class="mdi mdi-delete"></i> Delete</span>'
},
name: { label: 'Name', sortable: true, searchable: true },
username: { label: 'Username', sortable: false, searchable: true },
email: { label: 'Email' },
Expand All @@ -19943,17 +19947,13 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
render: function render(data) {
return 'https://' + data;
}
},
actions: {
label: 'Actions',
defaultContent: '<a href="javascript:void(0);" data-action="edit" class="btn btn-primary btn-sm"><i class="mdi mdi-square-edit-outline"></i> Edit</a>' + '<span data-action="delete" class="btn btn-danger btn-sm"><i class="mdi mdi-delete"></i> Delete</span>'
}
}
};
},

methods: {
alert: function alert(msg) {
doAlert: function doAlert(msg) {
window.alert(msg);
}
}
Expand Down Expand Up @@ -23744,10 +23744,10 @@ var render = function() {
attrs: { fields: _vm.fields, opts: _vm.options, selectable: true },
on: {
edit: function($event) {
_vm.alert("row edit button clicked")
_vm.doAlert("row edit button clicked")
},
delete: function($event) {
_vm.alert("row delete button clicked")
_vm.doAlert("row delete button clicked")
}
}
}),
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions example/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
:fields="fields"
:opts="options"
:selectable="true"
@edit="alert('row edit button clicked')"
@delete="alert('row delete button clicked')"
@edit="doAlert('row edit button clicked')"
@delete="doAlert('row delete button clicked')"
/>
<h3>Note:</h3>
<ul>
Expand Down Expand Up @@ -64,6 +64,11 @@ export default {
},
fields: {
id: { label: 'ID', sortable: true },
actions: {
label: 'Actions',
defaultContent: '<a href="javascript:void(0);" data-action="edit" class="btn btn-primary btn-sm"><i class="mdi mdi-square-edit-outline"></i> Edit</a>' +
'<span data-action="delete" class="btn btn-danger btn-sm"><i class="mdi mdi-delete"></i> Delete</span>'
},
name: { label: 'Name', sortable: true, searchable: true },
username: { label: 'Username', sortable: false, searchable: true },
email: { label: 'Email' },
Expand All @@ -77,17 +82,12 @@ export default {
render: (data) => {
return `https://${ data }`
}
},
actions: {
label: 'Actions',
defaultContent: '<a href="javascript:void(0);" data-action="edit" class="btn btn-primary btn-sm"><i class="mdi mdi-square-edit-outline"></i> Edit</a>' +
'<span data-action="delete" class="btn btn-danger btn-sm"><i class="mdi mdi-delete"></i> Delete</span>'
}
}
}
},
methods: {
alert(msg) {
doAlert(msg) {
window.alert(msg)
}
}
Expand Down

0 comments on commit d05230b

Please sign in to comment.