aboutsummaryrefslogtreecommitdiffstats
path: root/settings/src/components/popoverMenu/popoverItem.vue
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-03-09 17:46:34 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-05-16 09:50:20 +0200
commitc8f670dd8f2982f455662a24be67ad89f8ca2915 (patch)
tree296e14353e3a94b33b97c50646974840d1b3c4bd /settings/src/components/popoverMenu/popoverItem.vue
parent7de6c06c66df859f6e5ffcd4e0c85580b3c4d365 (diff)
downloadnextcloud-server-c8f670dd8f2982f455662a24be67ad89f8ca2915.tar.gz
nextcloud-server-c8f670dd8f2982f455662a24be67ad89f8ca2915.zip
Settings to vuejs
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'settings/src/components/popoverMenu/popoverItem.vue')
-rw-r--r--settings/src/components/popoverMenu/popoverItem.vue23
1 files changed, 23 insertions, 0 deletions
diff --git a/settings/src/components/popoverMenu/popoverItem.vue b/settings/src/components/popoverMenu/popoverItem.vue
new file mode 100644
index 00000000000..84907341327
--- /dev/null
+++ b/settings/src/components/popoverMenu/popoverItem.vue
@@ -0,0 +1,23 @@
+<template>
+ <li>
+ <a @click="dispatchToStore" v-if="item.href" :href="(item.href) ? item.href : '#' ">
+ <span :class="item.icon"></span>
+ <span>{{item.text}}</span>
+ </a>
+ <button @click="dispatchToStore(item.action)" v-else>
+ <span :class="item.icon"></span>
+ <span>{{item.text}}</span>
+ </button>
+ </li>
+</template>
+
+<script>
+export default {
+ props: ['item'],
+ methods: {
+ dispatchToStore () {
+ this.$store.dispatch(this.item.action, this.item.data);
+ }
+ }
+}
+</script>