12月16

AppSearch.vue

| |
15:17 软件分析与设计  From: 本站原创
阅读(416) | 评论(0) | 引用(0)

<script lang="tsx">
  import { defineComponent, ref, unref } from 'vue';
  import { Tooltip } from 'ant-design-vue';
  import { SearchOutlined } from '@ant-design/icons-vue';
  import AppSearchModal from './AppSearchModal.vue';
  import { useI18n } from '/@/hooks/web/useI18n';

  export default defineComponent({
    name: 'AppSearch',
    setup() {
      const showModal = ref(false);
      const { t } = useI18n();

      function changeModal(show: boolean) {
        showModal.value = show;
      }

      return () => {
        return (
          <div class="p-1" onClick={changeModal.bind(null, true)}>
            <Tooltip>
              {{
                title: () => t('common.searchText'),
                default: () => <SearchOutlined />,
              }}
            </Tooltip>
            <AppSearchModal onClose={changeModal.bind(null, false)} visible={unref(showModal)} />
          </div>
        );
      };
    },
  });
</script>

发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emot
打开HTML
打开UBB
打开表情
隐藏
记住我

昵称 : 

密码(可不填) :  游客无需密码

网址 (可不填) : 

电邮 (可不填) :  [注册]