Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
2628fb55
提交
2628fb55
authored
10月 25, 2020
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(drawer): refactor props detailType to isDetail
上级
491ba9a3
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
15 行增加
和
17 行删除
+15
-17
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+5
-0
BasicDrawer.tsx
src/components/Drawer/src/BasicDrawer.tsx
+3
-3
props.ts
src/components/Drawer/src/props.ts
+3
-4
types.ts
src/components/Drawer/src/types.ts
+1
-5
Drawer5.vue
src/views/demo/comp/drawer/Drawer5.vue
+3
-5
没有找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
2628fb55
...
@@ -5,6 +5,11 @@
...
@@ -5,6 +5,11 @@
-
面包屑支持显示图标
-
面包屑支持显示图标
-
新增 tinymce 富文本组件
-
新增 tinymce 富文本组件
-
表单新增 submitOnReset 控制是否在重置时重新发起请求
-
表单新增 submitOnReset 控制是否在重置时重新发起请求
-
表格新增
`sortFn`
支持自定义排序
### ✨ Refactor
-
Drawer 组件的 detailType 修改为 isDetail
### 🎫 Chores
### 🎫 Chores
...
...
src/components/Drawer/src/BasicDrawer.tsx
浏览文件 @
2628fb55
...
@@ -16,7 +16,7 @@ import { FullLoading } from '/@/components/Loading/index';
...
@@ -16,7 +16,7 @@ import { FullLoading } from '/@/components/Loading/index';
import
{
getSlot
}
from
'/@/utils/helper/tsxHelper'
;
import
{
getSlot
}
from
'/@/utils/helper/tsxHelper'
;
import
{
DrawerInstance
,
DrawerProps
,
DrawerType
}
from
'./types'
;
import
{
DrawerInstance
,
DrawerProps
}
from
'./types'
;
import
{
basicProps
}
from
'./props'
;
import
{
basicProps
}
from
'./props'
;
import
{
isFunction
,
isNumber
}
from
'/@/utils/is'
;
import
{
isFunction
,
isNumber
}
from
'/@/utils/is'
;
...
@@ -54,7 +54,7 @@ export default defineComponent({
...
@@ -54,7 +54,7 @@ export default defineComponent({
};
};
opt
.
title
=
undefined
;
opt
.
title
=
undefined
;
if
(
opt
.
drawerType
===
DrawerType
.
DETAIL
)
{
if
(
opt
.
isDetail
)
{
if
(
!
opt
.
width
)
{
if
(
!
opt
.
width
)
{
opt
.
width
=
'100%'
;
opt
.
width
=
'100%'
;
}
}
...
@@ -157,7 +157,7 @@ export default defineComponent({
...
@@ -157,7 +157,7 @@ export default defineComponent({
function
renderHeader
()
{
function
renderHeader
()
{
const
{
title
}
=
unref
(
getMergeProps
);
const
{
title
}
=
unref
(
getMergeProps
);
return
props
.
drawerType
===
DrawerType
.
DETAIL
?
(
return
props
.
isDetail
?
(
getSlot
(
slots
,
'title'
)
||
(
getSlot
(
slots
,
'title'
)
||
(
<
Row
type=
"flex"
align=
"middle"
class=
{
`${prefixCls}__detail-header`
}
>
<
Row
type=
"flex"
align=
"middle"
class=
{
`${prefixCls}__detail-header`
}
>
{
()
=>
(
{
()
=>
(
...
...
src/components/Drawer/src/props.ts
浏览文件 @
2628fb55
import
type
{
PropType
}
from
'vue'
;
import
type
{
PropType
}
from
'vue'
;
import
{
DrawerType
}
from
'./types'
;
// import {DrawerProps} from './types'
// import {DrawerProps} from './types'
export
const
footerProps
=
{
export
const
footerProps
=
{
confirmLoading
:
Boolean
as
PropType
<
boolean
>
,
confirmLoading
:
Boolean
as
PropType
<
boolean
>
,
...
@@ -41,9 +40,9 @@ export const footerProps = {
...
@@ -41,9 +40,9 @@ export const footerProps = {
},
},
};
};
export
const
basicProps
=
{
export
const
basicProps
=
{
drawerType
:
{
isDetail
:
{
type
:
Number
as
PropType
<
number
>
,
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
DrawerType
.
DEFAULT
,
default
:
false
,
},
},
title
:
{
title
:
{
type
:
String
as
PropType
<
string
>
,
type
:
String
as
PropType
<
string
>
,
...
...
src/components/Drawer/src/types.ts
浏览文件 @
2628fb55
...
@@ -20,10 +20,6 @@ export interface ReturnInnerMethods extends DrawerInstance {
...
@@ -20,10 +20,6 @@ export interface ReturnInnerMethods extends DrawerInstance {
export
type
UseDrawerReturnType
=
[
RegisterFn
,
ReturnMethods
];
export
type
UseDrawerReturnType
=
[
RegisterFn
,
ReturnMethods
];
export
type
UseDrawerInnerReturnType
=
[
RegisterFn
,
ReturnInnerMethods
];
export
type
UseDrawerInnerReturnType
=
[
RegisterFn
,
ReturnInnerMethods
];
export
enum
DrawerType
{
DETAIL
,
DEFAULT
,
}
export
interface
DrawerFooterProps
{
export
interface
DrawerFooterProps
{
showOkBtn
:
boolean
;
showOkBtn
:
boolean
;
...
@@ -69,7 +65,7 @@ export interface DrawerFooterProps {
...
@@ -69,7 +65,7 @@ export interface DrawerFooterProps {
footerHeight
:
string
|
number
;
footerHeight
:
string
|
number
;
}
}
export
interface
DrawerProps
extends
DrawerFooterProps
{
export
interface
DrawerProps
extends
DrawerFooterProps
{
drawerType
:
DrawerType
;
isDetail
?:
boolean
;
loading
?:
boolean
;
loading
?:
boolean
;
showDetailBack
?:
boolean
;
showDetailBack
?:
boolean
;
visible
?:
boolean
;
visible
?:
boolean
;
...
...
src/views/demo/comp/drawer/Drawer5.vue
浏览文件 @
2628fb55
<
template
>
<
template
>
<BasicDrawer
v-bind=
"$attrs"
:
drawerType=
"DrawerType.DETAIL
"
title=
"Drawer Title5"
>
<BasicDrawer
v-bind=
"$attrs"
:
isDetail=
"true
"
title=
"Drawer Title5"
>
<p
class=
"h-20"
>
Content Message
</p>
<p
class=
"h-20"
>
Content Message
</p>
</BasicDrawer>
</BasicDrawer>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'vue'
;
import
{
defineComponent
}
from
'vue'
;
import
{
BasicDrawer
,
DrawerType
}
from
'/@/components/Drawer'
;
import
{
BasicDrawer
}
from
'/@/components/Drawer'
;
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
BasicDrawer
},
components
:
{
BasicDrawer
},
setup
()
{
setup
()
{},
return
{
DrawerType
};
},
});
});
</
script
>
</
script
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论