aboutsummaryrefslogtreecommitdiffstats
path: root/settings/src/components/popoverMenu/popoverItem.vue
blob: 710aff80aa6ea47babd27b68a9e5a99f2f29174b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 : '#' ">
			<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 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>