Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
e027c510
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
725
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e027c510
编写于
11月 13, 2018
作者:
郭
郭胜强
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of github.com:dcloudio/uni-app
上级
d28259eb
5eafdb4e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
105 addition
and
170 deletion
+105
-170
examples/hello-uniapp/components/mpvue-wxparse/src/wxParse.css
...les/hello-uniapp/components/mpvue-wxparse/src/wxParse.css
+12
-12
examples/hello-uniapp/components/uni-nav-bar.vue
examples/hello-uniapp/components/uni-nav-bar.vue
+42
-71
examples/hello-uniapp/pages/template/nav-bar/nav-bar.vue
examples/hello-uniapp/pages/template/nav-bar/nav-bar.vue
+31
-20
examples/hello-uniapp/platforms/app-plus/tabbar/tabbar.vue
examples/hello-uniapp/platforms/app-plus/tabbar/tabbar.vue
+20
-67
未找到文件。
examples/hello-uniapp/components/mpvue-wxparse/src/wxParse.css
浏览文件 @
e027c510
...
...
@@ -32,36 +32,36 @@
padding
:
0
;
}
.wxParse
.h1
{
.wxParse
.h1
>
view
{
font-size
:
2em
;
margin
:
0.67em
0
;
}
.wxParse
.h2
{
.wxParse
.h2
>
view
{
font-size
:
1.5em
;
margin
:
0.83em
0
;
}
.wxParse
.h3
{
.wxParse
.h3
>
view
{
font-size
:
1.17em
;
margin
:
1em
0
;
}
.wxParse
.h4
{
.wxParse
.h4
>
view
{
margin
:
1.33em
0
;
}
.wxParse
.h5
{
.wxParse
.h5
>
view
{
font-size
:
0.83em
;
margin
:
1.67em
0
;
}
.wxParse
.h6
{
.wxParse
.h6
>
view
{
font-size
:
0.67em
;
margin
:
2.33em
0
;
}
.wxParse
.h1
,
.wxParse
.h2
,
.wxParse
.h3
,
.wxParse
.h4
,
.wxParse
.h5
,
.wxParse
.h6
,
.wxParse
.h1
>
view
,
.wxParse
.h2
>
view
,
.wxParse
.h3
>
view
,
.wxParse
.h4
>
view
,
.wxParse
.h5
>
view
,
.wxParse
.h6
>
view
,
.wxParse
.b
,
.wxParse
.strong
{
font-weight
:
bolder
;
...
...
examples/hello-uniapp/components/uni-nav-bar.vue
浏览文件 @
e027c510
<
template
>
<view
class=
"uni-navbar"
:class=
"
{'uni-navbar-fixed':isFixed,'uni-navbar-shadow':hasShadow}" :style="{'background-color':backgroundColor}">
<uni-status-bar
v-if=
"insertStatusBar"
></uni-status-bar>
<view
class=
"uni-navbar-header"
:style=
"
{color:color}">
<view
class=
"uni-navbar-btn uni-navbar-btn-left
"
@
tap=
"onClickLeft"
>
<view
v-if=
"leftIcon.length"
class=
"uni-navbar-btn-icon"
:class=
"
{'uni-navbar-btn-icon-left':!leftText.length}
">
<uni-icon
:type=
"leftIcon"
:color=
"color"
size=
"24"
></uni-icon>
</view>
<view
v-if=
"leftText.length"
class=
"uni-navbar-btn-text"
:class=
"
{'uni-navbar-btn-icon-left':!leftIcon.length}">
{{
leftText
}}
</view>
<slot
name=
"left"
></slot>
</view>
<view
class=
"uni-navbar-container"
>
<view
v-if=
"title.length"
class=
"uni-navbar-container-title"
>
{{
title
}}
</view>
<!-- 标题插槽 -->
<slot></slot>
</view>
<view
class=
"uni-navbar-btn uni-navbar-btn-right
"
@
tap=
"onClickRight"
>
<view
v-if=
"rightIcon.length"
class=
"uni-navbar-btn-icon uni-navbar-btn-icon-right"
>
<view
class=
"uni-navbar"
:class=
"
{'uni-navbar-fixed':isFixed,'uni-navbar-shadow':hasShadow}" :style="{'background-color':backgroundColor}">
<uni-status-bar
v-if=
"insertStatusBar"
></uni-status-bar>
<view
class=
"uni-navbar-header"
:style=
"
{color:color}">
<view
class=
"uni-navbar-header-btns
"
@
tap=
"onClickLeft"
>
<view
v-if=
"leftIcon.length
"
>
<uni-icon
:type=
"leftIcon"
:color=
"color"
size=
"24"
></uni-icon>
</view>
<view
v-if=
"leftText.length"
class=
"uni-navbar-btn-text"
:class=
"
{'uni-navbar-btn-icon-left':!leftIcon.length}">
{{
leftText
}}
</view>
<slot
name=
"left"
></slot>
</view>
<view
class=
"uni-navbar-container"
>
<view
v-if=
"title.length"
class=
"uni-navbar-container-title"
>
{{
title
}}
</view>
<!-- 标题插槽 -->
<slot></slot>
</view>
<view
class=
"uni-navbar-header-btns
"
@
tap=
"onClickRight"
>
<view
v-if=
"rightIcon.length"
>
<uni-icon
:type=
"rightIcon"
:color=
"color"
size=
"24"
></uni-icon>
</view>
<!-- 优先显示图标 -->
<view
v-if=
"rightText.length&&!rightIcon.length"
class=
"uni-navbar-btn-text"
>
{{
rightText
}}
</view>
<slot
name=
"right"
></slot>
</view>
</view>
</view>
</view>
</view>
</
template
>
<
script
>
...
...
@@ -162,7 +162,7 @@
}
.uni-navbar
view
{
line-height
:
2.75em
;
line-height
:
44px
;
}
.uni-navbar-shadow
{
...
...
@@ -178,57 +178,28 @@
display
:
flex
;
flex-direction
:
row
;
width
:
100%
;
height
:
2.75em
;
line-height
:
2.75em
;
height
:
44px
;
line-height
:
44px
;
font-size
:
16px
;
}
.uni-navbar-btn
{
position
:
relative
;
width
:
4.125em
;
text-align
:
center
;
display
:
flex
;
flex-direction
:
row
;
padding
:
0
0.125em
;
}
.uni-navbar-btn-icon
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
}
.uni-navbar-btn-icon-left
{
margin-left
:
0.625em
;
}
.uni-navbar-btn-icon-right
{
margin-right
:
0.625em
;
}
.uni-navbar-btn-text
{
padding
:
0
0.25em
;
overflow
:
hidden
;
}
.uni-navbar-btn-left
{
padding
:
0
0
0
0.125em
;
}
.uni-navbar-btn-right
{
padding
:
0
0.125em
0
0
;
flex-direction
:
row-reverse
;
}
.uni-navbar-container
{
position
:
relative
;
flex
:
1
;
}
.uni-navbar-container-title
{
text-align
:
center
;
color
:
#000000
;
padding
:
0
0.3125em
;
overflow
:
hidden
;
}
.uni-navbar-header
.uni-navbar-header-btns
{
display
:
inline-flex
;
flex-wrap
:
nowrap
;
flex-shrink
:
0
;
padding
:
0
12
upx
;
}
.uni-navbar-header
.uni-navbar-header-btns
:first-child
{
padding-left
:
0
;
}
.uni-navbar-container
{
width
:
100%
;
margin
:
0
10
upx
;
}
.uni-navbar-container-title
{
font-size
:
30
upx
;
text-align
:
center
;
}
</
style
>
examples/hello-uniapp/pages/template/nav-bar/nav-bar.vue
浏览文件 @
e027c510
...
...
@@ -4,17 +4,23 @@
<!-- 固定在顶部的导航栏 -->
<uni-nav-bar
fixed=
"true"
left-icon=
"back"
@
click-left=
"back"
@
click-right=
"showMenu"
left-text=
"返回"
right-text=
"菜单"
title=
"导航栏组件"
></uni-nav-bar>
<!--
占位用的导航栏
-->
<
uni-nav-bar
background-color=
"rgba(0,0,0,0)"
status-bar=
"true"
></uni-nav-bar
>
<!--
使用非原生导航栏后需要在页面顶部占位
-->
<
view
style=
"height:80px;"
>
...
</view
>
<!-- #endif -->
<view
class=
"title"
>
本导航栏为自定义组件,并非原生导航栏。除非原生导航栏无法满足需求,否则不推荐使用自定义导航栏组件。具体参考http://ask.dcloud.net.cn/article/34921
</view>
<view
class=
"title"
>
基础用法(注意右上角应避开微信小程序自带的胶囊按钮)
</view>
<uni-nav-bar
left-icon=
"back"
@
click-left=
"back"
title=
"标题"
></uni-nav-bar>
<!--
<uni-nav-bar
left-icon=
"camera"
@
click-left=
"clickLeft"
@
click-right=
"showMenu"
right-icon=
"bars"
title=
"标题"
></uni-nav-bar>
<uni-nav-bar
left-icon=
"back"
@
click-left=
"back"
left-text=
"返回"
title=
"标题"
></uni-nav-bar>
<uni-nav-bar
left-icon=
"back"
@
click-left=
"back"
@
click-right=
"showMenu"
left-text=
"返回"
right-text=
"菜单"
title=
"标题"
></uni-nav-bar>
<uni-nav-bar
left-icon=
"back"
@
click-left=
"showMenu"
@
click-right=
"showMenu"
left-text=
"菜单"
right-text=
"菜单"
title=
"标题"
></uni-nav-bar>
-->
<view
class=
"title"
>
其他常见样式
</view>
<view
class=
"uni-padding-wrap"
>
<view
class=
"uni-helllo-text uni-common-mt"
>
本导航栏为自定义组件,并非原生导航栏。除非原生导航栏无法满足需求,否则不推荐使用自定义导航栏组件。具体参考http://ask.dcloud.net.cn/article/34921
</view>
<view
class=
"uni-title uni-center uni-common-mt"
>
基础用法
<text>
\n返回图标 + 标题
</text>
</view>
</view>
<uni-nav-bar
left-icon=
"back"
left-text=
"返回"
@
click-left=
"back"
title=
"标题"
></uni-nav-bar>
<view
class=
"uni-title uni-center uni-common-mt"
>
其他常见样式
<text>
\n城市选择 + 搜索 + 右侧按钮
</text>
</view>
<uni-nav-bar
color=
"#333333"
background-color=
"#FFFFFF"
fixed=
"false"
right-icon=
"scan"
@
click-left=
"showCity"
@
click-right=
"scan"
>
<block
slot=
"left"
>
...
...
@@ -106,24 +112,29 @@
align-items
:
center
;
justify-content
:
center
;
width
:
100%
;
margin-left
:
8px
;
}
.input-view
{
position
:
absolute
;
width
:
100%
;
top
:
50%
;
transform
:
translateY
(
-50%
);
align-items
:
center
;
width
:
92%
;
display
:
flex
;
flex-direction
:
row
;
background-color
:
#e7e7e7
;
height
:
30px
;
border-radius
:
15px
;
padding
:
0
10px
;
padding
:
0
4%
;
flex-wrap
:
nowrap
;
margin
:
7px
0
;
line-height
:
30px
;
}
.input-view
.uni-icon
{
line-height
:
30px
!important
;
}
.input
{
flex
:
1
;
padding
:
0
5px
;
.input-view
.input
{
height
:
20px
;
line-height
:
20px
;
width
:
94%
;
padding
:
5px
3%
;
}
</
style
>
examples/hello-uniapp/platforms/app-plus/tabbar/tabbar.vue
浏览文件 @
e027c510
<
template
>
<view
class=
"
index
"
>
<scroll-view
id=
"tab-bar"
class=
"swiper-tab"
scroll-x
:scroll-left=
"scrollLeft"
>
<view
class=
"
uni-tab-bar
"
>
<scroll-view
id=
"tab-bar"
class=
"
uni-
swiper-tab"
scroll-x
:scroll-left=
"scrollLeft"
>
<view
v-for=
"(tab,index) in tabBars"
:key=
"tab.id"
:class=
"['swiper-tab-list',tabIndex==index ? 'active' : '']"
:id=
"tab.id"
:data-current=
"index"
@
tap=
"tapTab"
>
{{
tab
.
name
}}
</view>
</scroll-view>
...
...
@@ -10,22 +10,29 @@
<block
v-for=
"(newsitem,index2) in tab.data"
:key=
"index2"
>
<media-list
:data=
"newsitem"
@
close=
"close(index1,index2)"
@
click=
"goDetail(newsitem)"
></media-list>
</block>
<view
class=
"loadmore
"
>
<text
class=
"loadmore-text"
>
{{
tab
.
loadingText
}}
</text
>
</view>
<view
class=
"uni-tab-bar-loading
"
>
<load-more
:loadingType=
"tab.loadingType"
:contentText=
"loadingText"
></load-more
>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</
template
>
<
script
>
import
mediaList
from
'
@/components/tab-nvue/mediaList.vue
'
import
mediaList
from
'
@/components/tab-nvue/mediaList.vue
'
;
import
loadMore
from
'
@/components/load-more.vue
'
;
export
default
{
components
:
{
mediaList
mediaList
,
loadMore
},
data
()
{
return
{
loadingText
:
{
contentdown
:
"
上拉显示更多
"
,
contentrefresh
:
"
正在加载...
"
,
contentnomore
:
"
没有更多数据了
"
},
scrollLeft
:
0
,
isClickChange
:
false
,
tabIndex
:
0
,
...
...
@@ -131,19 +138,20 @@
})
},
loadMore
(
e
)
{
this
.
newsitems
[
e
].
loadingType
=
1
;
setTimeout
(()
=>
{
this
.
addData
(
e
);
},
1
0
00
);
},
1
2
00
);
},
addData
(
e
)
{
console
.
log
(
"
加载更多...
"
);
if
(
this
.
newsitems
[
e
].
data
.
length
>
30
)
{
this
.
newsitems
[
e
].
loadingText
=
'
没有更多了
'
;
this
.
newsitems
[
e
].
loadingType
=
2
;
return
;
}
for
(
let
i
=
1
;
i
<=
10
;
i
++
)
{
this
.
newsitems
[
e
].
data
.
push
(
this
[
'
data
'
+
Math
.
floor
(
Math
.
random
()
*
5
)]);
}
this
.
newsitems
[
e
].
loadingType
=
1
;
},
async
changeTab
(
e
)
{
let
index
=
e
.
target
.
current
;
...
...
@@ -197,7 +205,7 @@
let
ary
=
[];
for
(
let
i
=
0
,
length
=
this
.
tabBars
.
length
;
i
<
length
;
i
++
)
{
let
aryItem
=
{
loadingText
:
"
加载更多...
"
,
loadingType
:
0
,
data
:
[]
};
for
(
let
j
=
1
;
j
<=
10
;
j
++
)
{
...
...
@@ -212,60 +220,5 @@
</
script
>
<
style
>
page
{
display
:
flex
;
}
.index
{
display
:
flex
;
flex
:
1
;
flex-direction
:
column
;
overflow
:
hidden
;
height
:
100%
;
}
.list
{
width
:
750
upx
;
height
:
100%
;
}
.swiper-tab
{
width
:
100%
;
white-space
:
nowrap
;
line-height
:
100
upx
;
height
:
100
upx
;
border-bottom
:
1px
solid
#c8c7cc
;
}
.swiper-tab-list
{
font-size
:
30
upx
;
width
:
150
upx
;
display
:
inline-block
;
text-align
:
center
;
color
:
#555
;
}
.active
{
color
:
#007AFF
;
}
.swiper-box
{
flex
:
1
;
width
:
100%
;
height
:
calc
(
100%
-
100
upx
);
}
.loadmore
{
height
:
70
upx
;
width
:
750
upx
;
flex-direction
:
column
;
justify-content
:
center
;
}
.loadmore-text
{
font-size
:
30
upx
;
text-align
:
center
;
color
:
#999999
;
}
</
style
>
</
style
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录