feat: 避免移动端点击 tagsView 触发关闭

This commit is contained in:
Jesonhu 2018-08-28 00:50:32 +08:00
parent 325120b653
commit 007498ebd2
2 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@ const getters = {
setting: state => state.user.setting,
permission_routers: state => state.permission.routers,
addRouters: state => state.permission.addRouters,
errorLogs: state => state.errorLog.logs
errorLogs: state => state.errorLog.logs,
isMobile: state => state.app.device === 'mobile'
}
export default getters

View File

@ -10,7 +10,7 @@
class="tags-view-item"
@contextmenu.prevent.native="openMenu(tag,$event)">
{{ generateTitle(tag.title) }}
<span class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)"/>
<span v-show="!isMobile" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)"/>
</router-link>
</scroll-pane>
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
@ -22,6 +22,7 @@
</template>
<script>
import { mapGetters } from 'vuex'
import ScrollPane from '@/components/ScrollPane'
import { generateTitle } from '@/utils/i18n'
@ -36,6 +37,7 @@ export default {
}
},
computed: {
...mapGetters(['isMobile']),
visitedViews() {
return this.$store.state.tagsView.visitedViews
}