info
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
## 1.0.5(2021-12-25)
|
||||
1.0.5 兼容小程序
|
||||
## 1.0.3(2021-12-23)
|
||||
声明图标使用时uview 1.X的
|
||||
## 1.0.2(2021-08-29)
|
||||
1.0.2 更改标题
|
||||
## 1.0.1(2021-08-18)
|
||||
1.0.1 完善readme
|
||||
## 1.0.0(2021-08-18)
|
||||
1.0.0 发布组件
|
||||
@@ -0,0 +1,135 @@
|
||||
<template>
|
||||
<view class="top_nav" :style="{background:bgColor}">
|
||||
<view class="status_bar" :style="'height: '+ statusBarHeight"></view>
|
||||
<view class="toBar" :style="'height:'+toBarHeight">
|
||||
<view>
|
||||
<block v-if="showLeft == true">
|
||||
<slot>
|
||||
<u-icon name="arrow-left" @tap="toback" class="left_img" color="#ffffff"></u-icon>
|
||||
<text class="iconfont icon-fanhui left_icon" @tap="toback" v-if="leftBg == false" style="color: #202020;"></text>
|
||||
</slot>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- #ifndef H5 -->
|
||||
<text class="title" :style="'color:' + textcolor" v-if="showTitle == true">{{navTitle}}</text>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<text class="title bolds" :style="'color:' + textcolor" v-if="showTitle == true">{{navTitle}}</text>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
statusBarHeight(){
|
||||
return '0px'
|
||||
},
|
||||
toBarHeight(){
|
||||
return '0px'
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
props: {
|
||||
textcolor: {
|
||||
type: String,
|
||||
default: '#fff'
|
||||
},
|
||||
bgColor:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showLeft: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
navTitle: {
|
||||
type: String,
|
||||
default: '登录'
|
||||
},
|
||||
leftBg:{
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toback() {
|
||||
let pages = getCurrentPages()
|
||||
if(pages.length==1){
|
||||
console.log("只有一页");
|
||||
uni.switchTab({
|
||||
url:"/pages/index/index"
|
||||
})
|
||||
}else{
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.status_bar{
|
||||
width: 100vw;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
}
|
||||
.toBar{
|
||||
width: 100vw;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.left_icon{
|
||||
font-size: 32upx;
|
||||
position: absolute;
|
||||
left: 20upx;
|
||||
font-weight: 500;
|
||||
width: 60upx;
|
||||
height: 60upx;
|
||||
line-height: 60upx;
|
||||
}
|
||||
.toBar .title{
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 30upx;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.left_img{
|
||||
position: absolute;
|
||||
padding: 15rpx;
|
||||
left: 20rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 100;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.bolds{
|
||||
font-weight: bold;
|
||||
}
|
||||
.top_nav{
|
||||
position: fixed;
|
||||
top: 60upx;
|
||||
left: 15upx;
|
||||
z-index: 80;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"id": "zetank-backBar",
|
||||
"displayName": "常用页面后退按钮",
|
||||
"version": "1.0.5",
|
||||
"description": "常用页面后退按钮",
|
||||
"keywords": [
|
||||
"后退按钮"
|
||||
],
|
||||
"repository": "",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.0"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"前端组件",
|
||||
"通用组件"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "插件不采集任何数据",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "u"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "u",
|
||||
"Android Browser": "u",
|
||||
"微信浏览器(Android)": "u",
|
||||
"QQ浏览器(Android)": "u"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "u",
|
||||
"IE": "u",
|
||||
"Edge": "u",
|
||||
"Firefox": "u",
|
||||
"Safari": "u"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "u",
|
||||
"阿里": "u",
|
||||
"百度": "u",
|
||||
"字节跳动": "u",
|
||||
"QQ": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "u"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
# zetank-backBar
|
||||
>点击返回一页,如果只有1页,返回首页
|
||||
>H5后退按钮组件,组件使用uview,使用前请自己安装插件[uview 1.X](https://v1.uviewui.com/components/npmSetting.html)
|
||||
|
||||
|
||||
###安装
|
||||
下载组件到项目即可,本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范
|
||||
|
||||
###使用
|
||||
```html
|
||||
<zetank-backBar textcolor="#000" :showLeft="true" :showTitle="false" navTitle='标题'></zetank-backBar>
|
||||
```
|
||||
Reference in New Issue
Block a user