This commit is contained in:
syuilo 2018-02-18 13:48:40 +09:00
parent b2c24af69e
commit 2f3f97a12c
3 changed files with 9 additions and 8 deletions

View file

@ -4,6 +4,9 @@
<template v-if="item.type == 'item'"> <template v-if="item.type == 'item'">
<p @click="click(item)"><span class="icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}</p> <p @click="click(item)"><span class="icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}</p>
</template> </template>
<template v-if="item.type == 'link'">
<a :href="item.href" :target="item.target" @click="click(item)"><span class="icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}</a>
</template>
<template v-else-if="item.type == 'nest'"> <template v-else-if="item.type == 'nest'">
<p><span class="icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}...<span class="caret">%fa:caret-right%</span></p> <p><span class="icon" v-if="item.icon" v-html="item.icon"></span>{{ item.text }}...<span class="caret">%fa:caret-right%</span></p>
<me-nu :menu="item.menu" @x="click"/> <me-nu :menu="item.menu" @x="click"/>
@ -31,11 +34,9 @@ export default Vue.extend({
$item-height = 38px $item-height = 38px
$padding = 10px $padding = 10px
ul margin 0
display block padding $padding 0
margin 0 list-style none
padding $padding 0
list-style none
li li
display block display block

View file

@ -1,5 +1,5 @@
<template> <template>
<div class="context-menu" :style="{ x: `${x}px`, y: `${y}px` }" @contextmenu.prevent="() => {}"> <div class="context-menu" :style="{ left: `${x}px`, top: `${y}px` }" @contextmenu.prevent="() => {}">
<me-nu :menu="menu" @x="click"/> <me-nu :menu="menu" @x="click"/>
</div> </div>
</template> </template>

View file

@ -16,7 +16,7 @@ import Vue from 'vue';
import * as anime from 'animejs'; import * as anime from 'animejs';
export default Vue.extend({ export default Vue.extend({
props: { props: ['title', 'text', 'buttons', 'modal']/*{
title: { title: {
type: String type: String
}, },
@ -30,7 +30,7 @@ export default Vue.extend({
type: Boolean, type: Boolean,
default: false default: false
} }
}, }*/,
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
(this.$refs.bg as any).style.pointerEvents = 'auto'; (this.$refs.bg as any).style.pointerEvents = 'auto';