Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
5af45275
提交
5af45275
authored
9月 18, 2021
作者:
无木
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: hmr error fixed
修复部分组件可能会造成热更新异常的问题
上级
9c5f11a5
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
42 行增加
和
67 行删除
+42
-67
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+3
-1
Dropdown.vue
src/components/Dropdown/src/Dropdown.vue
+21
-34
IconPicker.vue
src/components/Icon/src/IconPicker.vue
+18
-32
没有找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
5af45275
...
...
@@ -16,7 +16,9 @@
-
修复点击关闭按钮、最大化按钮旁边的空白区域也会导致
`Modal`
关闭的问题
-
**BasicTree**
修复节点插槽不起作用的问题
-
**CodeEditor**
修复可能会造成的
`Build`
失败的问题
-
**其它**
修复多标签在某些情况下关闭页签不会跳转路由的问题
-
**其它**
-
修复多标签在某些情况下关闭页签不会跳转路由的问题
-
修复部分组件可能会造成热更新异常的问题
## 2.7.2(2021-09-14)
...
...
src/components/Dropdown/src/Dropdown.vue
浏览文件 @
5af45275
<
template
>
<
D
ropdown
:trigger=
"trigger"
v-bind=
"$attrs"
>
<
a-d
ropdown
:trigger=
"trigger"
v-bind=
"$attrs"
>
<span>
<slot></slot>
</span>
<template
#
overlay
>
<
M
enu
:selectedKeys=
"selectedKeys"
>
<
a-m
enu
:selectedKeys=
"selectedKeys"
>
<template
v-for=
"item in dropMenuList"
:key=
"`$
{item.event}`">
<
MenuI
tem
<
a-menu-i
tem
v-bind=
"getAttr(item.event)"
@
click=
"handleClickMenu(item)"
:disabled=
"item.disabled"
>
<
P
opconfirm
<
a-p
opconfirm
v-if=
"popconfirm && item.popConfirm"
v-bind=
"getPopConfirmAttrs(item.popConfirm)"
>
...
...
@@ -22,40 +22,34 @@
<Icon
:icon=
"item.icon"
v-if=
"item.icon"
/>
<span
class=
"ml-1"
>
{{ item.text }}
</span>
</div>
</
P
opconfirm>
</
a-p
opconfirm>
<
template
v-else
>
<Icon
:icon=
"item.icon"
v-if=
"item.icon"
/>
<span
class=
"ml-1"
>
{{
item
.
text
}}
</span>
</
template
>
</
MenuI
tem>
<
MenuD
ivider
v-if=
"item.divider"
:key=
"`d-${item.event}`"
/>
</
a-menu-i
tem>
<
a-menu-d
ivider
v-if=
"item.divider"
:key=
"`d-${item.event}`"
/>
</template>
</
M
enu>
</
a-m
enu>
</template>
</
D
ropdown>
</
a-d
ropdown>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
setup
>
import
{
computed
,
PropType
}
from
'vue'
;
import
type
{
DropMenu
}
from
'./typing'
;
import
{
defineComponent
}
from
'vue'
;
import
{
Dropdown
,
Menu
,
Popconfirm
}
from
'ant-design-vue'
;
import
{
Icon
}
from
'/@/components/Icon'
;
import
{
omit
}
from
'lodash-es'
;
import
{
isFunction
}
from
'/@/utils/is'
;
export
default
defineComponent
({
name
:
'BasicDropdown'
,
components
:
{
Dropdown
,
Menu
,
MenuItem
:
Menu
.
Item
,
MenuDivider
:
Menu
.
Divider
,
Icon
,
Popconfirm
,
},
props
:
{
const
ADropdown
=
Dropdown
;
const
AMenu
=
Menu
;
const
AMenuItem
=
Menu
.
Item
;
const
AMenuDivider
=
Menu
.
Divider
;
const
APopconfirm
=
Popconfirm
;
const
props
=
defineProps
({
popconfirm
:
Boolean
,
/**
* the trigger mode which executes the drop-down action
...
...
@@ -76,9 +70,10 @@
type
:
Array
as
PropType
<
string
[]
>
,
default
:
()
=>
[],
},
},
emits
:
[
'menuEvent'
],
setup
(
props
,
{
emit
})
{
});
const
emit
=
defineEmits
([
'menuEvent'
]);
function
handleClickMenu
(
item
:
DropMenu
)
{
const
{
event
}
=
item
;
const
menu
=
props
.
dropMenuList
.
find
((
item
)
=>
`
${
item
.
event
}
`
===
`
${
event
}
`
);
...
...
@@ -96,12 +91,4 @@
return
originAttrs
;
};
});
return
{
handleClickMenu
,
getPopConfirmAttrs
,
getAttr
:
(
key
:
string
|
number
)
=>
({
key
}),
};
},
});
</
script
>
src/components/Icon/src/IconPicker.vue
浏览文件 @
5af45275
...
...
@@ -7,7 +7,7 @@
v-model:value="currentSelect"
>
<template
#
addonAfter
>
<
P
opover
<
a-p
opover
placement=
"bottomLeft"
trigger=
"click"
v-model=
"visible"
...
...
@@ -17,7 +17,7 @@
<div
class=
"flex justify-between"
>
<a-input
:placeholder=
"t('component.icon.search')"
@
change=
"
h
andleSearchChange"
@
change=
"
debounceH
andleSearchChange"
allowClear
/>
</div>
...
...
@@ -53,7 +53,7 @@
</ul>
</ScrollContainer>
<div
class=
"flex py-2 items-center justify-center"
v-if=
"getTotal >= pageSize"
>
<
P
agination
<
a-p
agination
showLessItems
size=
"small"
:pageSize=
"pageSize"
...
...
@@ -63,7 +63,7 @@
</div>
</div>
<template
v-else
><div
class=
"p-5"
><
E
mpty
/></div>
><div
class=
"p-5"
><
a-e
mpty
/></div>
</
template
>
</template>
...
...
@@ -71,16 +71,14 @@
<SvgIcon
:name=
"currentSelect"
/>
</span>
<Icon
:icon=
"currentSelect || 'ion:apps-outline'"
class=
"cursor-pointer px-2 py-1"
v-else
/>
</
P
opover>
</
a-p
opover>
</template>
</a-input>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
,
watchEffect
,
watch
,
unref
}
from
'vue'
;
<
script
lang=
"ts"
setup
>
import
{
ref
,
watchEffect
,
watch
,
unref
}
from
'vue'
;
import
{
useDesign
}
from
'/@/hooks/web/useDesign'
;
import
{
ScrollContainer
}
from
'/@/components/Container'
;
import
{
Input
,
Popover
,
Pagination
,
Empty
}
from
'ant-design-vue'
;
import
Icon
from
'./Icon.vue'
;
import
SvgIcon
from
'./SvgIcon.vue'
;
...
...
@@ -94,6 +92,12 @@
import
{
useMessage
}
from
'/@/hooks/web/useMessage'
;
import
svgIcons
from
'virtual:svg-icons-names'
;
// 没有使用别名引入,是因为WebStorm当前版本还不能正确识别,会报unused警告
const
AInput
=
Input
;
const
APopover
=
Popover
;
const
APagination
=
Pagination
;
const
AEmpty
=
Empty
;
function
getIcons
()
{
const
data
=
iconsData
as
any
;
const
prefix
:
string
=
data
?.
prefix
??
''
;
...
...
@@ -110,19 +114,16 @@
return
svgIcons
.
map
((
icon
)
=>
icon
.
replace
(
'icon-'
,
''
));
}
export
default
defineComponent
({
name
:
'IconPicker'
,
components
:
{
[
Input
.
name
]:
Input
,
Icon
,
Popover
,
ScrollContainer
,
Pagination
,
Empty
,
SvgIcon
},
inheritAttrs
:
false
,
props
:
{
const
props
=
defineProps
({
value
:
propTypes
.
string
,
width
:
propTypes
.
string
.
def
(
'100%'
),
pageSize
:
propTypes
.
number
.
def
(
140
),
copy
:
propTypes
.
bool
.
def
(
false
),
mode
:
propTypes
.
oneOf
<
(
'svg'
|
'iconify'
)[]
>
([
'svg'
,
'iconify'
]).
def
(
'iconify'
),
},
emits
:
[
'change'
,
'update:value'
],
setup
(
props
,
{
emit
})
{
});
const
emit
=
defineEmits
([
'change'
,
'update:value'
]);
const
isSvgMode
=
props
.
mode
===
'svg'
;
const
icons
=
isSvgMode
?
getSvgIcons
()
:
getIcons
();
...
...
@@ -177,21 +178,6 @@
}
currentList
.
value
=
icons
.
filter
((
item
)
=>
item
.
includes
(
value
));
}
return
{
t
,
prefixCls
,
visible
,
isSvgMode
,
getTotal
,
getPaginationList
,
handlePageChange
,
handleClick
,
currentSelect
,
handleSearchChange
:
debounceHandleSearchChange
,
};
},
});
</
script
>
<
style
lang=
"less"
>
@prefix-cls
:
~
'@{namespace}-icon-picker'
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论