Browse Source

Add v-shortkey, fix #1258

pull/1260/head
Hironsan 3 years ago
parent
commit
892bbfed68
1 changed files with 5 additions and 4 deletions
  1. 9
      frontend/pages/projects/_id/text-classification/index.vue

9
frontend/pages/projects/_id/text-classification/index.vue

@ -18,7 +18,10 @@
/>
</template>
<template v-slot:content>
<v-card @shortkey="addOrRemove">
<v-card
v-shortkey="shortKeys"
@shortkey="addOrRemove"
>
<v-card-title>
<text-classification
:labels="labels"
@ -37,14 +40,12 @@
</template>
<script>
import Vue from 'vue'
import _ from 'lodash'
import LayoutText from '@/components/tasks/layout/LayoutText'
import ListMetadata from '@/components/tasks/metadata/ListMetadata'
import TextClassification from '@/components/tasks/textClassification/TextClassification'
import ToolbarLaptop from '@/components/tasks/toolbar/ToolbarLaptop'
import ToolbarMobile from '@/components/tasks/toolbar/ToolbarMobile'
Vue.use(require('vue-shortkey'))
export default {
layout: 'workspace',
@ -129,7 +130,7 @@ export default {
async addOrRemove(event) {
const label = this.labels.find(item => item.id === parseInt(event.srcKey, 10))
const annotation = this.doc.annotations.find(item => item.label === label.id)
const annotation = this.annotations.find(item => item.label === label.id)
if (annotation) {
await this.remove(annotation.id)
} else {

Loading…
Cancel
Save