Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
readpage
Undraw Ui
提交
4c952fcf
U
Undraw Ui
项目概览
readpage
/
Undraw Ui
大约 1 年 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
Undraw Ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4c952fcf
编写于
5月 11, 2023
作者:
R
readpage
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:
✨
[search] 添加关闭下拉框隐藏方法 (#11)
closed #11
上级
ab360b41
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
8 deletion
+14
-8
demo/components/search.vue
demo/components/search.vue
+5
-3
packages/src/components/search/src/card-box.vue
packages/src/components/search/src/card-box.vue
+1
-1
packages/src/components/search/src/search.vue
packages/src/components/search/src/search.vue
+8
-4
未找到文件。
demo/components/search.vue
浏览文件 @
4c952fcf
<
template
>
<u-search
:config=
"config"
style=
"margin-left: 20px"
@
submit=
"submit"
></u-search>
<u-search
:config=
"config"
style=
"margin-left: 20px"
@
submit=
"submit"
ref=
"searchRef"
></u-search>
<div>
abdds
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
onMounted
,
reactive
}
from
'
vue
'
import
{
SearchConfig
}
from
'
~/index
'
import
{
onMounted
,
reactive
,
ref
}
from
'
vue
'
import
{
SearchConfig
,
SearchInstance
}
from
'
~/index
'
defineOptions
({
name
:
'
search
'
})
const
searchRef
=
ref
<
SearchInstance
>
()
const
config
=
reactive
<
SearchConfig
>
({
keywords
:
[],
hotSearchList
:
[]
...
...
packages/src/components/search/src/card-box.vue
浏览文件 @
4c952fcf
<
template
>
<div
v-show=
"data.
cardV
isible && visible"
class=
"card-box u-scrollbar"
>
<div
v-show=
"data.
v
isible && visible"
class=
"card-box u-scrollbar"
>
<div
v-if=
"data.historySearchList.length != 0"
class=
"history"
>
<div
class=
"header"
>
<div
class=
"title"
>
历史搜索
</div>
...
...
packages/src/components/search/src/search.vue
浏览文件 @
4c952fcf
...
...
@@ -27,7 +27,7 @@
@
focus=
"
() =>
{
isFocus = true
data.
cardV
isible = true
data.
v
isible = true
}
"
@blur="isFocus = false"
...
...
@@ -60,7 +60,7 @@
</div>
</div>
<CardBox
v-click-outside:[labelRef]=
"() => (data.
cardV
isible = false)"
v-click-outside:[labelRef]=
"() => (data.
v
isible = false)"
:data=
"data"
@
on-close=
"closeHander"
@
on-clear=
"removeAllHistory"
...
...
@@ -82,7 +82,7 @@ export interface HistoryApi {
export
interface
DataApi
{
search
:
string
cardV
isible
:
boolean
v
isible
:
boolean
historySearchList
:
HistoryApi
[]
hotSearchList
:
string
[]
}
...
...
@@ -111,7 +111,7 @@ const state = reactive({
const
data
=
reactive
<
DataApi
>
({
search
:
''
,
cardV
isible
:
false
,
v
isible
:
false
,
historySearchList
:
storage
.
get
(
'
searchHistory
'
)
||
[],
// 历史搜索数据
hotSearchList
:
props
.
config
.
hotSearchList
})
...
...
@@ -196,6 +196,10 @@ const animationend = (e: AnimationEvent) => {
},
3000
)
}
}
defineExpose
({
close
:
()
=>
data
.
visible
=
false
})
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录