summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/src/components/popoverMenu/popoverItem.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/updatenotification/src/components/popoverMenu/popoverItem.vue')
-rw-r--r--apps/updatenotification/src/components/popoverMenu/popoverItem.vue28
1 files changed, 28 insertions, 0 deletions
diff --git a/apps/updatenotification/src/components/popoverMenu/popoverItem.vue b/apps/updatenotification/src/components/popoverMenu/popoverItem.vue
new file mode 100644
index 00000000000..d496a336c22
--- /dev/null
+++ b/apps/updatenotification/src/components/popoverMenu/popoverItem.vue
@@ -0,0 +1,28 @@
+<template>
+ <li>
+ <!-- If item.href is set, a link will be directly used -->
+ <a @click="item.action" v-if="item.href" :href="(item.href) ? item.href : '#' " :target="(item.target) ? item.target : '' " rel="noreferrer noopener">
+ <span :class="item.icon"></span>
+ <span v-if="item.text">{{item.text}}</span>
+ <p v-else-if="item.longtext">{{item.longtext}}</p>
+ </a>
+ <!-- If item.action is set instead, a button will be used -->
+ <button @click="item.action" v-else-if="item.action">
+ <span :class="item.icon"></span>
+ <span v-if="item.text">{{item.text}}</span>
+ <p v-else-if="item.longtext">{{item.longtext}}</p>
+ </button>
+ <!-- If item.longtext is set AND the item does not have an action -->
+ <span class="menuitem" v-else>
+ <span :class="item.icon"></span>
+ <span v-if="item.text">{{item.text}}</span>
+ <p v-else-if="item.longtext">{{item.longtext}}</p>
+ </span>
+ </li>
+</template>
+
+<script>
+export default {
+ props: ['item']
+}
+</script>