Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui
提交
9a7ff783
N
nutui
项目概览
京东前端
/
nutui
通知
37
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nutui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9a7ff783
编写于
10月 30, 2020
作者:
richard_1015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: cell
上级
95e74fe3
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
22 addition
and
18 deletion
+22
-18
src/packages/cell/demo.vue
src/packages/cell/demo.vue
+1
-9
src/packages/cell/index.scss
src/packages/cell/index.scss
+15
-0
src/packages/cell/index.vue
src/packages/cell/index.vue
+5
-7
src/packages/icon/index.vue
src/packages/icon/index.vue
+1
-2
未找到文件。
src/packages/cell/demo.vue
浏览文件 @
9a7ff783
...
@@ -5,22 +5,14 @@
...
@@ -5,22 +5,14 @@
<nut-cell
title=
"我是标题"
sub-title=
"副标题描述"
desc=
"描述文字"
></nut-cell>
<nut-cell
title=
"我是标题"
sub-title=
"副标题描述"
desc=
"描述文字"
></nut-cell>
<h2>
链接
</h2>
<h2>
链接
</h2>
<nut-cell
title=
"链接"
is-link
></nut-cell>
<nut-cell
title=
"链接"
is-link
></nut-cell>
<nut-cell
title=
"URL 跳转"
is-link
url=
"https://jd.com"
></nut-cell>
<nut-cell
title=
"URL 跳转"
desc=
"https://jd.com"
is-link
url=
"https://jd.com"
></nut-cell>
<nut-cell
title=
"路由跳转 ’/‘ "
to=
"/"
></nut-cell>
<nut-cell
title=
"路由跳转 ’/‘ "
to=
"/"
></nut-cell>
<h2>
使用插槽
</h2>
<nut-cell>
<!-- 使用 title 插槽来自定义标题 -->
<template
#title
>
<span
class=
"custom-title"
>
单元格
</span>
</
template
>
</nut-cell>
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Cell
from
'
@/packages/cell/index.vue
'
;
import
Cell
from
'
@/packages/cell/index.vue
'
;
import
{
createComponent
}
from
'
@/utils/create
'
;
import
{
createComponent
}
from
'
@/utils/create
'
;
import
{
ref
}
from
'
vue
'
;
const
{
createDemo
}
=
createComponent
(
'
cell
'
);
const
{
createDemo
}
=
createComponent
(
'
cell
'
);
export
default
createDemo
({
export
default
createDemo
({
props
:
{},
props
:
{},
...
...
src/packages/cell/index.scss
浏览文件 @
9a7ff783
.nut-cell
{
.nut-cell
{
position
:
relative
;
display
:
flex
;
display
:
flex
;
width
:
100%
;
width
:
100%
;
line-height
:
20px
;
line-height
:
20px
;
...
@@ -9,6 +10,20 @@
...
@@ -9,6 +10,20 @@
font-size
:
$cell-title-font
;
font-size
:
$cell-title-font
;
color
:
$cell-color
;
color
:
$cell-color
;
margin
:
10px
0
;
margin
:
10px
0
;
&
::before
{
position
:
absolute
;
top
:
50%
;
left
:
50%
;
width
:
100%
;
height
:
100%
;
background-color
:
$black
;
border
:
inherit
;
border-color
:
$black
;
border-radius
:
inherit
;
transform
:
translate
(
-50%
,
-50%
);
opacity
:
0
;
content
:
' '
;
}
&
:active::before
{
&
:active::before
{
opacity
:
0
.1
;
opacity
:
0
.1
;
}
}
...
...
src/packages/cell/index.vue
浏览文件 @
9a7ff783
...
@@ -9,14 +9,13 @@
...
@@ -9,14 +9,13 @@
{{
title
}}
{{
title
}}
</
template
>
</
template
>
</view>
</view>
<view
class=
"nut-cell__value"
>
{{ desc }}
</view>
<view
v-if=
"desc"
class=
"nut-cell__value"
>
{{ desc }}
</view>
<nut-icon
v-if=
"isLink || to"
name=
"right"
></nut-icon>
<nut-icon
v-if=
"isLink || to"
name=
"right"
></nut-icon>
<slot></slot>
</view>
</view>
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
toRefs
,
computed
,
PropType
}
from
'
vue
'
;
import
{
toRefs
,
computed
}
from
'
vue
'
;
import
{
createComponent
}
from
'
@/utils/create
'
;
import
{
createComponent
}
from
'
@/utils/create
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
Icon
from
'
@/packages/icon/index.vue
'
;
import
Icon
from
'
@/packages/icon/index.vue
'
;
...
@@ -36,7 +35,7 @@ export default create({
...
@@ -36,7 +35,7 @@ export default create({
[
Icon
.
name
]:
Icon
[
Icon
.
name
]:
Icon
},
},
emits
:
[
'
click
'
],
emits
:
[
'
click
'
],
setup
(
props
,
{
emit
,
slots
})
{
setup
(
props
,
{
emit
})
{
const
{
title
,
to
,
desc
,
subTitle
,
isLink
,
url
,
replace
}
=
toRefs
(
props
);
const
{
title
,
to
,
desc
,
subTitle
,
isLink
,
url
,
replace
}
=
toRefs
(
props
);
const
classes
=
computed
(()
=>
{
const
classes
=
computed
(()
=>
{
const
prefixCls
=
componentName
;
const
prefixCls
=
componentName
;
...
@@ -50,11 +49,10 @@ export default create({
...
@@ -50,11 +49,10 @@ export default create({
const
handleClick
=
(
event
:
Event
)
=>
{
const
handleClick
=
(
event
:
Event
)
=>
{
emit
(
'
click
'
,
event
);
emit
(
'
click
'
,
event
);
debugger
;
if
(
to
.
value
&&
router
)
{
if
(
to
.
value
&&
router
)
{
router
[
replace
?
'
replace
'
:
'
push
'
](
to
.
value
);
router
[
replace
.
value
?
'
replace
'
:
'
push
'
](
to
.
value
);
}
else
if
(
url
.
value
)
{
}
else
if
(
url
.
value
)
{
replace
?
location
.
replace
(
url
.
value
)
:
(
location
.
href
=
url
.
value
);
replace
.
value
?
location
.
replace
(
url
.
value
)
:
(
location
.
href
=
url
.
value
);
}
}
};
};
...
...
src/packages/icon/index.vue
浏览文件 @
9a7ff783
...
@@ -15,7 +15,7 @@ export default create({
...
@@ -15,7 +15,7 @@ export default create({
},
},
components
:
{},
components
:
{},
emits
:
[
'
click
'
],
emits
:
[
'
click
'
],
setup
(
props
,
{
emit
,
slots
})
{
setup
(
props
,
{
emit
})
{
const
{
name
}
=
toRefs
(
props
);
const
{
name
}
=
toRefs
(
props
);
const
classes
=
computed
(()
=>
{
const
classes
=
computed
(()
=>
{
const
prefixCls
=
componentName
;
const
prefixCls
=
componentName
;
...
@@ -31,7 +31,6 @@ export default create({
...
@@ -31,7 +31,6 @@ export default create({
return
{
return
{
handleClick
,
handleClick
,
name
,
name
,
classes
classes
};
};
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录