Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui
提交
a44ba341
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,发现更多精彩内容 >>
提交
a44ba341
编写于
11月 05, 2020
作者:
A
ailululu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'next' of
https://github.com/jdf2e/nutui
into next
上级
209ecbd8
7d6fdb66
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
82 addition
and
54 deletion
+82
-54
src/config.ts
src/config.ts
+4
-4
src/packages/cell/index.vue
src/packages/cell/index.vue
+13
-11
src/packages/price/demo.vue
src/packages/price/demo.vue
+12
-16
src/sites/assets/styles/md-style.scss
src/sites/assets/styles/md-style.scss
+0
-2
src/sites/assets/util/ref.ts
src/sites/assets/util/ref.ts
+3
-0
src/sites/doc/App.vue
src/sites/doc/App.vue
+1
-0
src/sites/doc/components/Header.vue
src/sites/doc/components/Header.vue
+5
-0
src/sites/doc/components/Nav.vue
src/sites/doc/components/Nav.vue
+28
-15
src/sites/doc/router.ts
src/sites/doc/router.ts
+4
-2
src/sites/doc/views/Index.vue
src/sites/doc/views/Index.vue
+11
-3
src/sites/mobile/components/Index.vue
src/sites/mobile/components/Index.vue
+1
-1
未找到文件。
src/config.ts
浏览文件 @
a44ba341
...
...
@@ -53,13 +53,13 @@ export const nav = [
author
:
'
richard1015
'
},
{
name
:
'
p
rice
'
,
sort
:
1
,
name
:
'
P
rice
'
,
sort
:
4
,
cName
:
'
价格组件
'
,
type
:
'
component
'
,
show
:
true
,
desc
:
'
'
// author: 'hahaha
'
desc
:
'
价格组件
'
,
author
:
'
ailululu
'
}
]
},
...
...
src/packages/cell/index.vue
浏览文件 @
a44ba341
<
template
>
<view
:class=
"classes"
@
click=
"handleClick"
>
<view
class=
"nut-cell__title"
>
<template
v-if=
"subTitle"
>
<view
class=
"title"
>
{{
title
}}
</view>
<view
class=
"nut-cell__title-desc"
>
{{
subTitle
}}
</view>
</
template
>
<
template
v-else
>
{{
title
}}
</
template
>
</view>
<view
v-if=
"desc"
class=
"nut-cell__value"
>
{{ desc }}
</view>
<nut-icon
v-if=
"isLink || to"
name=
"right"
></nut-icon>
<slot>
<view
class=
"nut-cell__title"
>
<template
v-if=
"subTitle"
>
<view
class=
"title"
>
{{
title
}}
</view>
<view
class=
"nut-cell__title-desc"
>
{{
subTitle
}}
</view>
</
template
>
<
template
v-else
>
{{
title
}}
</
template
>
</view>
<view
v-if=
"desc"
class=
"nut-cell__value"
>
{{ desc }}
</view>
<nut-icon
v-if=
"isLink || to"
name=
"right"
></nut-icon>
</slot>
</view>
</template>
...
...
src/packages/price/demo.vue
浏览文件 @
a44ba341
<
template
>
<div
class=
"demo"
>
<h2>
基本用法
</h2>
<
div
class=
"demo-price-box"
>
<
nut-cell
>
<nut-price
:price=
"1010"
:needSymbol=
"false"
:thousands=
"true"
/>
</
div
>
</
nut-cell
>
<h2>
无人民币符号,有千位分隔
</h2>
<
div
class=
"demo-price-box"
>
<
nut-cell
>
<nut-price
:price=
"10010.01"
:needSymbol=
"true"
:thousands=
"false"
/>
</
div
>
</
nut-cell
>
<h2>
带人民币符号,有千位分隔,保留小数点后三位
</h2>
<
div
class=
"demo-price-box"
>
<
nut-cell
>
<nut-price
:price=
"15213.1221"
:decimalDigits=
"3"
:needSymbol=
"true"
:thousands=
"true"
/>
</
div
>
</
nut-cell
>
</div>
</
template
>
<
script
lang=
"ts"
>
import
Price
from
'
@/packages/price/index.vue
'
;
import
Cell
from
'
@/packages/cell/index.vue
'
;
import
{
createComponent
}
from
'
@/utils/create
'
;
const
{
createDemo
}
=
createComponent
(
'
price
'
);
export
default
createDemo
({
props
:
{
text
:
String
},
components
:
{
[
Price
.
name
]:
Price
}
components
:
{
[
Price
.
name
]:
Price
,
[
Cell
.
name
]:
Cell
}
});
</
script
>
<
style
lang=
"scss"
scoped
>
.demo-price-box
{
padding
:
5px
20px
;
min-height
:
43px
;
background
:
rgba
(
255
,
255
,
255
,
1
);
border-radius
:
7px
;
box-shadow
:
0px
1px
7px
0px
rgba
(
237
,
238
,
241
,
1
);
}
</
style
>
<
style
lang=
"scss"
scoped
></
style
>
src/sites/assets/styles/md-style.scss
浏览文件 @
a44ba341
...
...
@@ -2,10 +2,8 @@
.doc-content-document
{
position
:
relative
;
margin
:
10px
;
width
:
800px
;
background
:
#fff
;
border-left
:
1px
solid
#eee
;
padding-left
:
58px
;
.card
{
margin-bottom
:
24px
;
...
...
src/sites/assets/util/ref.ts
0 → 100644
浏览文件 @
a44ba341
import
{
ref
}
from
'
vue
'
;
export
const
currentRoute
=
ref
(
'
/
'
);
src/sites/doc/App.vue
浏览文件 @
a44ba341
...
...
@@ -20,5 +20,6 @@ export default defineComponent({
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
padding-top
:
$doc-header-height
;
}
</
style
>
src/sites/doc/components/Header.vue
浏览文件 @
a44ba341
...
...
@@ -13,6 +13,11 @@ export default defineComponent({
<
style
lang=
"scss"
>
.doc
{
&
-header
{
position
:
fixed
;
z-index
:
2
;
top
:
0
;
left
:
0
;
right
:
0
;
background
:
$doc-header-bg
;
background-size
:
cover
;
background-position
:
center
;
...
...
src/sites/doc/components/Nav.vue
浏览文件 @
a44ba341
...
...
@@ -12,8 +12,8 @@
<ol
v-for=
"_nav in nav"
:key=
"_nav"
>
<li>
{{
_nav
.
name
}}
</li>
<ul>
<li
class=
"active
"
v-for=
"_package in _nav.packages"
:key=
"_package"
>
<router-link
:to=
"_package.name.toLo
caleLo
werCase()"
>
<li
:class=
"
{ active: isActive(_package.name) }
" v-for="_package in _nav.packages" :key="_package">
<router-link
:to=
"_package.name.toLowerCase()"
>
{{
_package
.
name
}}
<b>
{{
_package
.
cName
}}
</b>
</router-link>
</li>
...
...
@@ -22,14 +22,22 @@
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
reactive
}
from
'
vue
'
;
import
{
defineComponent
,
reactive
,
computed
}
from
'
vue
'
;
import
{
currentRoute
}
from
'
@/sites/assets/util/ref
'
;
import
{
nav
}
from
'
@/config
'
;
export
default
defineComponent
({
name
:
'
doc-nav
'
,
setup
()
{
return
reactive
({
nav
const
isActive
=
computed
(()
=>
{
return
function
(
name
:
string
)
{
return
currentRoute
.
value
==
name
.
toLowerCase
();
};
});
return
{
isActive
,
nav
:
reactive
(
nav
),
currentRoute
};
}
});
</
script
>
...
...
@@ -37,11 +45,16 @@ export default defineComponent({
<
style
lang=
"scss"
>
.doc
{
&
-nav
{
position
:
fixed
;
top
:
$doc-header-height
+
50
;
left
:
0
;
bottom
:
0
;
z-index
:
1
;
background
:
$white
;
width
:
29
1
px
;
flex-shrink
:
0
;
height
:
100%
;
padding
:
50px
0
50px
35px
;
width
:
29
0
px
;
border-right
:
1px
solid
#eee
;
overflow
:
auto
;
padding
-left
:
35px
;
ol
{
&
.introduce
{
padding-left
:
5px
;
...
...
@@ -66,12 +79,12 @@ export default defineComponent({
content
:
''
;
left
:
0
;
top
:
50%
;
margin-top
:
-14
px
;
bottom
:
0
;
width
:
6
px
;
height
:
28px
;
background
:
$doc-default-primary-bg
;
b
order-radius
:
3px
;
width
:
22
px
;
margin-top
:
-5px
;
height
:
10
px
;
transform
:
rotate
(
90deg
)
;
background
:
url(https://img10.360buyimg.com/imagetools/jfs/t1/136135/19/14659/946/5fa20aa8E33a9aa26/d329fbe669171208.png)
no-repeat
;
b
ackground-size
:
100%
100%
;
}
}
}
...
...
src/sites/doc/router.ts
浏览文件 @
a44ba341
...
...
@@ -6,9 +6,11 @@ const pagesRouter: Array<RouteRecordRaw> = [];
const
files
=
require
.
context
(
'
@/packages
'
,
true
,
/doc
\.
md$/
);
files
.
keys
().
forEach
(
component
=>
{
const
componentEntity
=
files
(
component
).
default
;
const
name
=
`
${
component
.
split
(
'
/
'
)[
1
]}
`
;
pagesRouter
.
push
({
path
:
`/
${
component
.
split
(
'
/
'
)[
1
]}
`
,
component
:
componentEntity
path
:
name
,
component
:
componentEntity
,
name
});
});
const
routes
:
Array
<
RouteRecordRaw
>
=
[
...
...
src/sites/doc/views/Index.vue
浏览文件 @
a44ba341
<
template
>
<doc-header></doc-header>
<doc-nav></doc-nav>
<div
class=
"doc-content"
>
<doc-nav></doc-nav>
<doc-demo-preview
:url=
"demoUrl"
></doc-demo-preview>
<div
class=
"doc-content-document"
>
<router-view
/>
</div>
<doc-footer></doc-footer>
<doc-demo-preview
:url=
"demoUrl"
></doc-demo-preview>
</div>
<doc-footer></doc-footer>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
reactive
}
from
'
vue
'
;
...
...
@@ -16,6 +16,7 @@ import Header from '@/sites/doc/components/Header.vue';
import
Nav
from
'
@/sites/doc/components/Nav.vue
'
;
import
Footer
from
'
@/sites/doc/components/Footer.vue
'
;
import
DemoPreview
from
'
@/sites/doc/components/DemoPreview.vue
'
;
import
{
currentRoute
}
from
'
@/sites/assets/util/ref
'
;
export
default
defineComponent
({
name
:
'
doc
'
,
components
:
{
...
...
@@ -31,6 +32,7 @@ export default defineComponent({
onBeforeRouteUpdate
(
to
=>
{
const
{
origin
,
pathname
}
=
window
.
location
;
currentRoute
.
value
=
to
.
name
as
string
;
data
.
demoUrl
=
`
${
origin
}${
pathname
.
replace
(
'
index.html
'
,
''
)}
demo.html#
${
to
.
path
}
`
;
});
...
...
@@ -42,7 +44,13 @@ export default defineComponent({
<
style
lang=
"scss"
scoped
>
.doc
{
&
-content
{
margin-left
:
290px
;
display
:
flex
;
flex-direction
:
column
;
&
-document
{
min-height
:
800px
;
}
}
}
</
style
>
src/sites/mobile/components/Index.vue
浏览文件 @
a44ba341
...
...
@@ -12,7 +12,7 @@
<li>
{{
_nav
.
name
}}
</li>
<ul>
<li
v-for=
"_package in _nav.packages"
:key=
"_package"
>
<router-link
:to=
"_package.name.toLo
caleLo
werCase()"
>
{{
_package
.
name
}}
{{
_package
.
cName
}}
</router-link>
<router-link
:to=
"_package.name.toLowerCase()"
>
{{
_package
.
name
}}
{{
_package
.
cName
}}
</router-link>
</li>
</ul>
</ol>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录