Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-id-pages-x
提交
6d189a96
H
hello uni-id-pages-x
项目概览
DCloud
/
hello uni-id-pages-x
通知
42
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-id-pages-x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
6d189a96
编写于
12月 09, 2024
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新 移动uni-navbar-lite到 uni-id-pages-x 里面
上级
4eaf406d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
209 addition
and
209 deletion
+209
-209
uni_modules/uni-id-pages-x/components/uni-navbar-lite/uni-icons.css
...s/uni-id-pages-x/components/uni-navbar-lite/uni-icons.css
+0
-0
uni_modules/uni-id-pages-x/components/uni-navbar-lite/uni-navbar-lite.uvue
...d-pages-x/components/uni-navbar-lite/uni-navbar-lite.uvue
+119
-119
uni_modules/uni-id-pages-x/components/uni-navbar-lite/uni-navbar-lite.vue
...id-pages-x/components/uni-navbar-lite/uni-navbar-lite.vue
+90
-90
uni_modules/uni-id-pages-x/components/uni-navbar-lite/uniicons.ttf
...es/uni-id-pages-x/components/uni-navbar-lite/uniicons.ttf
+0
-0
未找到文件。
components/uni-navbar-lite/uni-icons.css
→
uni_modules/uni-id-pages-x/
components/uni-navbar-lite/uni-icons.css
浏览文件 @
6d189a96
文件已移动
components/uni-navbar-lite/uni-navbar-lite.uvue
→
uni_modules/uni-id-pages-x/
components/uni-navbar-lite/uni-navbar-lite.uvue
浏览文件 @
6d189a96
<template>
<view class="uni-navbar">
<view class="uni-navbar-inner" :style="navbarStyle">
<view class="left-content" @click="back">
<text :style="{ color: textColor }" class="uni-icons">{{
unicode
}}</text>
</view>
<view class="uni-navbar-content" :class="{ 'is-left': isLeft }">
<text :style="{ color: textColor }">
<slot>{{ title }}</slot>
</text>
</view>
<view class="right-content">
<slot name="right"></slot>
</view>
</view>
</view>
</template>
<script>
import iconpath from "./uniicons.ttf";
export default {
name: "uni-navbar",
props: {
title: {
type: String,
default: "",
},
isLeft: {
type: Boolean,
default: false,
},
textColor: {
type: String,
default: "#000",
},
},
data() {
return {
statusBarHeight: 0,
};
},
computed: {
navbarStyle() : string {
return `margin-top:${this.statusBarHeight}px`;
},
unicode() : string {
return "\ue600";
},
},
created() {
uni.loadFontFace({
global: false,
family: "UniIconsFontFamily",
source: `url("${iconpath}")`,
success() { },
fail(err) {
console.log(err);
},
});
const sys = uni.getSystemInfoSync();
const statusBarHeight = sys.statusBarHeight;
this.statusBarHeight = statusBarHeight;
},
mounted() {
uni.setNavigationBarColor({
frontColor: "#000000",
backgroundColor: "#ffffff",
});
},
methods: {
back() {
uni.navigateBack({});
},
},
};
</script>
<style>
.uni-icons {
font-family: "UniIconsFontFamily" !important;
font-size: 26px;
font-style: normal;
color: #333;
}
.uni-navbar {
background-color: #fff;
}
.uni-navbar-inner {
position: relative;
flex-direction: row;
justify-content: space-between;
height: 45px;
}
.left-content,
.right-content {
justify-content: center;
<template>
<view class="uni-navbar">
<view class="uni-navbar-inner" :style="navbarStyle">
<view class="left-content" @click="back">
<text :style="{ color: textColor }" class="uni-icons">{{
unicode
}}</text>
</view>
<view class="uni-navbar-content" :class="{ 'is-left': isLeft }">
<text :style="{ color: textColor }">
<slot>{{ title }}</slot>
</text>
</view>
<view class="right-content">
<slot name="right"></slot>
</view>
</view>
</view>
</template>
<script>
import iconpath from "./uniicons.ttf";
export default {
name: "uni-navbar",
props: {
title: {
type: String,
default: "",
},
isLeft: {
type: Boolean,
default: false,
},
textColor: {
type: String,
default: "#000",
},
},
data() {
return {
statusBarHeight: 0,
};
},
computed: {
navbarStyle() : string {
return `margin-top:${this.statusBarHeight}px`;
},
unicode() : string {
return "\ue600";
},
},
created() {
uni.loadFontFace({
global: false,
family: "UniIconsFontFamily",
source: `url("${iconpath}")`,
success() { },
fail(err) {
console.log(err);
},
});
const sys = uni.getSystemInfoSync();
const statusBarHeight = sys.statusBarHeight;
this.statusBarHeight = statusBarHeight;
},
mounted() {
uni.setNavigationBarColor({
frontColor: "#000000",
backgroundColor: "#ffffff",
});
},
methods: {
back() {
uni.navigateBack({});
},
},
};
</script>
<style>
.uni-icons {
font-family: "UniIconsFontFamily" !important;
font-size: 26px;
font-style: normal;
color: #333;
}
.uni-navbar {
background-color: #fff;
}
.uni-navbar-inner {
position: relative;
flex-direction: row;
justify-content: space-between;
height: 45px;
}
.left-content,
.right-content {
justify-content: center;
align-items: center;
width: 18%;
height: 100%;
}
.uni-navbar-content {
position: absolute;
height: 100%;
top: 0;
bottom: 0;
left: 45px;
right: 45px;
flex-direction: row;
justify-content: center;
align-items: center;
}
.is-left {
justify-content: flex-start;
}
height: 100%;
}
.uni-navbar-content {
position: absolute;
height: 100%;
top: 0;
bottom: 0;
left: 45px;
right: 45px;
flex-direction: row;
justify-content: center;
align-items: center;
}
.is-left {
justify-content: flex-start;
}
</style>
components/uni-navbar-lite/uni-navbar-lite.vue
→
uni_modules/uni-id-pages-x/
components/uni-navbar-lite/uni-navbar-lite.vue
浏览文件 @
6d189a96
<
template
>
<view
class=
"uni-navbar"
>
<view
class=
"uni-navbar-inner"
:style=
"navbarStyle"
>
<view
class=
"left-content"
@
click=
"back"
>
<text
class=
"uni-icons uniui-back"
></text>
</view>
<view
class=
"uni-navbar-content"
>
<slot>
{{
title
}}
</slot>
</view>
<view
class=
"right-content"
>
<slot
name=
"right"
></slot>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
name
:
"
uni-navbar
"
,
props
:
{
title
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
statusBarHeight
:
0
};
},
computed
:
{
navbarStyle
()
{
return
`margin-top:
${
this
.
statusBarHeight
}
px`
},
},
created
()
{
const
sys
=
uni
.
getSystemInfoSync
()
const
statusBarHeight
=
sys
.
statusBarHeight
this
.
statusBarHeight
=
statusBarHeight
},
methods
:
{
back
()
{
uni
.
navigateBack
({})
}
},
}
</
script
>
<
style
>
@import
'./uni-icons.css'
;
.uni-icons
{
font-family
:
UniIconsLight
;
text-decoration
:
none
;
text-align
:
center
;
font-size
:
22px
;
font-style
:
normal
;
color
:
#333
;
}
.uni-navbar
{
border
:
1px
#eee
solid
;
background-color
:
#fff
;
}
.uni-navbar-inner
{
position
:
relative
;
flex-direction
:
row
;
justify-content
:
space-between
;
height
:
45px
;
}
.left-content
,
.right-content
{
justify-content
:
center
;
align-items
:
center
;
width
:
45px
;
height
:
100%
;
}
.uni-navbar-content
{
position
:
absolute
;
height
:
100%
;
top
:
0
;
bottom
:
0
;
left
:
45px
;
right
:
45px
;
justify-content
:
center
;
align-items
:
center
;
}
<
template
>
<view
class=
"uni-navbar"
>
<view
class=
"uni-navbar-inner"
:style=
"navbarStyle"
>
<view
class=
"left-content"
@
click=
"back"
>
<text
class=
"uni-icons uniui-back"
></text>
</view>
<view
class=
"uni-navbar-content"
>
<slot>
{{
title
}}
</slot>
</view>
<view
class=
"right-content"
>
<slot
name=
"right"
></slot>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
name
:
"
uni-navbar
"
,
props
:
{
title
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
statusBarHeight
:
0
};
},
computed
:
{
navbarStyle
()
{
return
`margin-top:
${
this
.
statusBarHeight
}
px`
},
},
created
()
{
const
sys
=
uni
.
getSystemInfoSync
()
const
statusBarHeight
=
sys
.
statusBarHeight
this
.
statusBarHeight
=
statusBarHeight
},
methods
:
{
back
()
{
uni
.
navigateBack
({})
}
},
}
</
script
>
<
style
>
@import
'./uni-icons.css'
;
.uni-icons
{
font-family
:
UniIconsLight
;
text-decoration
:
none
;
text-align
:
center
;
font-size
:
22px
;
font-style
:
normal
;
color
:
#333
;
}
.uni-navbar
{
border
:
1px
#eee
solid
;
background-color
:
#fff
;
}
.uni-navbar-inner
{
position
:
relative
;
flex-direction
:
row
;
justify-content
:
space-between
;
height
:
45px
;
}
.left-content
,
.right-content
{
justify-content
:
center
;
align-items
:
center
;
width
:
45px
;
height
:
100%
;
}
.uni-navbar-content
{
position
:
absolute
;
height
:
100%
;
top
:
0
;
bottom
:
0
;
left
:
45px
;
right
:
45px
;
justify-content
:
center
;
align-items
:
center
;
}
</
style
>
components/uni-navbar-lite/uniicons.ttf
→
uni_modules/uni-id-pages-x/
components/uni-navbar-lite/uniicons.ttf
浏览文件 @
6d189a96
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录