Skip to content

Commit

Permalink
feat: 优化 ui 显示
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Dec 1, 2023
1 parent cc472c0 commit 1ecc5fc
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions src/components/SearchCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getNodeLabel } from '@/utils/node';
import { copy } from '@/utils/others';
import { githubJpgStorage, githubZipStorage } from '@/utils/storage';
import { githubUrlToSelfUrl } from '@/utils/url';
import JSON5 from 'json5'
import JSON5 from 'json5';
const props = withDefaults(
defineProps<{
Expand Down Expand Up @@ -188,7 +188,10 @@ const _1vw = window.innerWidth / 100;
:key="selectorResult.selector.toString()"
>
<template #header>
<span break-all>
<span v-if="selectorResult.results.length > 1" underline decoration-1 m-r-4px title="查询数量">
{{ selectorResult.results.length }}
</span>
<span break-all title="选择器">
{{ selectorResult.selector.toString() }}
</span>
</template>
Expand All @@ -197,15 +200,36 @@ const _1vw = window.innerWidth / 100;
size="small"
v-if="typeof selectorResult.selector == 'object'"
@click.stop="generateRules(selectorResult.selector as Selector)"
title="复制规则"
>
生成规则
<template #icon>
<NIcon>
<svg viewBox="0 0 24 24">
<path
d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"
fill="currentColor"
></path>
</svg>
</NIcon>
</template>
</NButton>
<div p-l-8px></div>
<NButton
size="small"
@click.stop="selectorResults.splice(index, 1)"
title="删除记录"
>
删除
<template #icon>
<NIcon>
<svg viewBox="0 0 24 24">
<g fill="none">
<path
d="M12 1.75a3.25 3.25 0 0 1 3.245 3.066L15.25 5h5.25a.75.75 0 0 1 .102 1.493L20.5 6.5h-.796l-1.28 13.02a2.75 2.75 0 0 1-2.561 2.474l-.176.006H8.313a2.75 2.75 0 0 1-2.714-2.307l-.023-.174L4.295 6.5H3.5a.75.75 0 0 1-.743-.648L2.75 5.75a.75.75 0 0 1 .648-.743L3.5 5h5.25A3.25 3.25 0 0 1 12 1.75zm6.197 4.75H5.802l1.267 12.872a1.25 1.25 0 0 0 1.117 1.122l.127.006h7.374c.6 0 1.109-.425 1.225-1.002l.02-.126L18.196 6.5zM13.75 9.25a.75.75 0 0 1 .743.648L14.5 10v7a.75.75 0 0 1-1.493.102L13 17v-7a.75.75 0 0 1 .75-.75zm-3.5 0a.75.75 0 0 1 .743.648L11 10v7a.75.75 0 0 1-1.493.102L9.5 17v-7a.75.75 0 0 1 .75-.75zm1.75-6a1.75 1.75 0 0 0-1.744 1.606L10.25 5h3.5A1.75 1.75 0 0 0 12 3.25z"
fill="currentColor"
></path>
</g></svg
></NIcon>
</template>
</NButton>
</template>
<NSpace
Expand Down

0 comments on commit 1ecc5fc

Please sign in to comment.