Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
啊嘞嘞EC
vue-vben-admin
提交
2628fb55
V
vue-vben-admin
项目概览
啊嘞嘞EC
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2628fb55
编写于
10月 25, 2020
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(drawer): refactor props detailType to isDetail
上级
491ba9a3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
17 deletion
+15
-17
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+5
-0
src/components/Drawer/src/BasicDrawer.tsx
src/components/Drawer/src/BasicDrawer.tsx
+3
-3
src/components/Drawer/src/props.ts
src/components/Drawer/src/props.ts
+3
-4
src/components/Drawer/src/types.ts
src/components/Drawer/src/types.ts
+1
-5
src/views/demo/comp/drawer/Drawer5.vue
src/views/demo/comp/drawer/Drawer5.vue
+3
-5
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
2628fb55
...
...
@@ -5,6 +5,11 @@
-
面包屑支持显示图标
-
新增 tinymce 富文本组件
-
表单新增 submitOnReset 控制是否在重置时重新发起请求
-
表格新增
`sortFn`
支持自定义排序
### ✨ Refactor
-
Drawer 组件的 detailType 修改为 isDetail
### 🎫 Chores
...
...
src/components/Drawer/src/BasicDrawer.tsx
浏览文件 @
2628fb55
...
...
@@ -16,7 +16,7 @@ import { FullLoading } from '/@/components/Loading/index';
import
{
getSlot
}
from
'
/@/utils/helper/tsxHelper
'
;
import
{
DrawerInstance
,
DrawerProps
,
DrawerType
}
from
'
./types
'
;
import
{
DrawerInstance
,
DrawerProps
}
from
'
./types
'
;
import
{
basicProps
}
from
'
./props
'
;
import
{
isFunction
,
isNumber
}
from
'
/@/utils/is
'
;
...
...
@@ -54,7 +54,7 @@ export default defineComponent({
};
opt
.
title
=
undefined
;
if
(
opt
.
drawerType
===
DrawerType
.
DETAIL
)
{
if
(
opt
.
isDetail
)
{
if
(
!
opt
.
width
)
{
opt
.
width
=
'
100%
'
;
}
...
...
@@ -157,7 +157,7 @@ export default defineComponent({
function
renderHeader
()
{
const
{
title
}
=
unref
(
getMergeProps
);
return
props
.
drawerType
===
DrawerType
.
DETAIL
?
(
return
props
.
isDetail
?
(
getSlot
(
slots
,
'
title
'
)
||
(
<
Row
type
=
"flex"
align
=
"middle"
class
=
{
`
${
prefixCls
}
__detail-header`
}
>
{
()
=>
(
...
...
src/components/Drawer/src/props.ts
浏览文件 @
2628fb55
import
type
{
PropType
}
from
'
vue
'
;
import
{
DrawerType
}
from
'
./types
'
;
// import {DrawerProps} from './types'
export
const
footerProps
=
{
confirmLoading
:
Boolean
as
PropType
<
boolean
>
,
...
...
@@ -41,9 +40,9 @@ export const footerProps = {
},
};
export
const
basicProps
=
{
drawerType
:
{
type
:
Number
as
PropType
<
number
>
,
default
:
DrawerType
.
DEFAULT
,
isDetail
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
},
title
:
{
type
:
String
as
PropType
<
string
>
,
...
...
src/components/Drawer/src/types.ts
浏览文件 @
2628fb55
...
...
@@ -20,10 +20,6 @@ export interface ReturnInnerMethods extends DrawerInstance {
export
type
UseDrawerReturnType
=
[
RegisterFn
,
ReturnMethods
];
export
type
UseDrawerInnerReturnType
=
[
RegisterFn
,
ReturnInnerMethods
];
export
enum
DrawerType
{
DETAIL
,
DEFAULT
,
}
export
interface
DrawerFooterProps
{
showOkBtn
:
boolean
;
...
...
@@ -69,7 +65,7 @@ export interface DrawerFooterProps {
footerHeight
:
string
|
number
;
}
export
interface
DrawerProps
extends
DrawerFooterProps
{
drawerType
:
DrawerType
;
isDetail
?:
boolean
;
loading
?:
boolean
;
showDetailBack
?:
boolean
;
visible
?:
boolean
;
...
...
src/views/demo/comp/drawer/Drawer5.vue
浏览文件 @
2628fb55
<
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>
</BasicDrawer>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
;
import
{
BasicDrawer
,
DrawerType
}
from
'
/@/components/Drawer
'
;
import
{
BasicDrawer
}
from
'
/@/components/Drawer
'
;
export
default
defineComponent
({
components
:
{
BasicDrawer
},
setup
()
{
return
{
DrawerType
};
},
setup
()
{},
});
</
script
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录