Browse Source

chore(nc-gui): lint

pull/3931/head
braks 2 years ago
parent
commit
4df9f2a0c1
  1. 16
      packages/nc-gui/components/cell/MultiSelect.vue

16
packages/nc-gui/components/cell/MultiSelect.vue

@ -1,8 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import tinycolor from 'tinycolor2' import tinycolor from 'tinycolor2'
import type { Select as AntSelect } from 'ant-design-vue' import type { Select as AntSelect } from 'ant-design-vue'
import { SelectOptionType } from 'nocodb-sdk' import type { SelectOptionType, SelectOptionsType } from 'nocodb-sdk'
import type { SelectOptionsType } from 'nocodb-sdk'
import { import {
ActiveCellInj, ActiveCellInj,
ColumnInj, ColumnInj,
@ -56,14 +55,15 @@ const options = computed<SelectOptionType[]>(() => {
return [] return []
}) })
const vModel = computed<string[]>({ const vModel = computed({
get: () => selectedIds.value.flatMap((el) => { get: () =>
const title = options.value.find((op) => op.id === el)?.title selectedIds.value.reduce((acc, id) => {
const title = options.value.find((op) => op.id === id)?.title
if (title) return [title] if (title) acc.push(title)
return [] as string[] return acc
}) || [] as string[], }, [] as string[]),
set: (val) => emit('update:modelValue', val.length === 0 ? null : val.join(',')), set: (val) => emit('update:modelValue', val.length === 0 ? null : val.join(',')),
}) })

Loading…
Cancel
Save