🐛 fix external links in sidemenu (#1720)

* fix admin link clickability

* fix bug when there are unsaved changes
This commit is contained in:
Mutasem Aldmour
2021-05-04 18:55:39 +03:00
committed by GitHub
parent 715e41b590
commit 0cb96d6caa
5 changed files with 90 additions and 57 deletions

View File

@@ -0,0 +1,44 @@
<template>
<div>
<el-menu-item
v-for="item in items"
:key="item.id"
:index="item.id"
@click="onClick(item)"
>
<font-awesome-icon :icon="item.properties.icon" />
<span slot="title" :class="{'item-title-root': root, 'item-title': !root}">{{ item.properties.title }}</span>
</el-menu-item>
</div>
</template>
<script lang="ts">
import { IMenuItem } from '../Interface';
import Vue from 'vue';
export default Vue.extend({
name: 'MenuItemsIterator',
props: [
'items',
'root',
],
methods: {
onClick(item: IMenuItem) {
if (item && item.type === 'link' && item.properties) {
const href = item.properties.href;
if (!href) {
return;
}
if (item.properties.newWindow) {
window.open(href);
}
else {
window.location.assign(item.properties.href);
}
}
},
},
});
</script>