Skip to content
Snippets Groups Projects
popoverItem.vue 884 B
Newer Older
John Molakvoæ's avatar
John Molakvoæ committed
<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 : '#' ">
John Molakvoæ's avatar
John Molakvoæ committed
			<span :class="item.icon"></span>
			<span v-if="item.text">{{item.text}}</span>
			<p v-else-if="item.longtext">{{item.longtext}}</p>
John Molakvoæ's avatar
John Molakvoæ committed
		</a>
		<!-- If item.action is set instead, a button will be used -->
		<button @click="item.action" v-else-if="item.action">
John Molakvoæ's avatar
John Molakvoæ committed
			<span :class="item.icon"></span>
			<span v-if="item.text">{{item.text}}</span>
			<p v-else-if="item.longtext">{{item.longtext}}</p>
John Molakvoæ's avatar
John Molakvoæ committed
		</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>
John Molakvoæ's avatar
John Molakvoæ committed
	</li>
</template>

<script>
export default {
John Molakvoæ's avatar
John Molakvoæ committed
}
</script>