Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ pro-search]searchFileds的key值是0或false,第一次点击选项会清空,第二次点击才能选中 #1746

Closed
ljf52007 opened this issue Nov 27, 2023 · 1 comment · Fixed by #1748
Labels
invalid This doesn't seem right

Comments

@ljf52007
Copy link

ljf52007 commented Nov 27, 2023

bug:searchFileds的key值是0或false,第一次点击选项会清空,第二次点击才能选中
复现demo:

<template>
  <div style="padding: 24px">
    <IxProSearch
                 class="pull-right"
                 style="width: 80%"
                 :value.sync="filterValue"
                 :clearable="true"
                 :searchFields="searchFields"
                 overlay-container='pro-search-wrapper--loophole'>
    </IxProSearch>
  </div>
</template>
 
<script setup lang="ts">
  import {ref, computed} from 'vue'
 
const filterValue = ref<SearchValue[]>([]);
  const searchFields = computed<SearchField[]>(() => [
    {
        type: 'select',
        label: '终端类型',
        key: 'host_type',
        quickSelect: true,
        placeholder: '终端类型',
        fieldConfig: {
            multiple: false,
            searchable: true,
            dataSource: [
              { label: '全部', key: 1},
              { label: 'PC', key:0},
              { label: '服务器', key:3},
          ]
        }
    },
     
]);
const searchKeys = computed(() => searchFields.value.map(i => i.key as string));
const filterFields = (fields: SearchField[], keys: string[]) => {
  return fields.filter(field => keys.includes(field.key as string))
}
</script>

复现链接:https://playground.idux.site/

Copy link

idux-bot bot commented Nov 27, 2023

Hello @ljf52007, your issue has been closed because it does not conform to our issue requirements.
Please use the issue template to create an issue, thank you!

你好 @ljf52007,为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。
你可以通过 issue 模板来创建 issue 以方便我们定位错误。谢谢配合!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant