From a1561dfe3a728f3b636852df05d36c1947883dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 30 Jan 2019 11:16:29 +0100 Subject: Add property-defined actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- src/mixins/PropertyMixin.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mixins/PropertyMixin.js') diff --git a/src/mixins/PropertyMixin.js b/src/mixins/PropertyMixin.js index 73b3f21c..cdb166f2 100644 --- a/src/mixins/PropertyMixin.js +++ b/src/mixins/PropertyMixin.js @@ -76,6 +76,17 @@ export default { } }, + computed: { + actions() { + const del = { + text: t('contacts', 'Delete'), + icon: 'icon-delete', + action: this.deleteProperty + } + return [del, ...this.propModel.actions ? this.propModel.actions : []] + } + }, + watch: { /** * Since we're updating a local data based on the value prop, -- cgit v1.2.3