当前位置: 首页 > news >正文

大连全套网站建设免费发帖推广平台有哪些

大连全套网站建设,免费发帖推广平台有哪些,视频网站logo怎么做的,青岛网站建设公司外包我们在用uniapp 开发应用的时候,有的页面需要自定义导航, 1.如果普通的直接使用uni 扩展柜组件的 uni-nav-bar 也基本够用, 2.如果稍微带点自定义的这个值无法支持的,特别在小程序端,胶囊是会压住右边的按钮的 自定…

我们在用uniapp 开发应用的时候,有的页面需要自定义导航,

1.如果普通的直接使用uni 扩展柜组件的 uni-nav-bar 也基本够用,

2.如果稍微带点自定义的这个值无法支持的,特别在小程序端,胶囊是会压住右边的按钮的

自定义个写 支持插槽

不带插槽的直接使用 自定义值看props里面的
小程序端
在这里插入图片描述
h5 app端
在这里插入图片描述

1.新建组件 目录结构 components/NavBar.vue

NavBar.vue 文件
<template><view> <view class='navbar' :style="{'backgroundColor':bgcolor,'z-index':zindex}"><view :style="{'height':tops+'px'}"></view><view :style="{'height':height+'px','line-height':height+'px'}"><view class='mainbox' :style="{'width':widtH+'px','height':'100%'}"><slot name="lf" :style="{'height':height+'px'}" v-if='isBack'><view class="nav-bar-lf"><uni-icons :type="licon" size="25" :color="titColor" @click="goBack"></uni-icons></view></slot><slot name="lc" :style="{'height':height+'px','color':titColor}"><view class="nav-bar-lc" :style="{'color':titColor}">{{title}}</view></slot><slot name="lr" :style="{'height':height+'px'}" v-if='isRbtn'><view class="nav-bar-lr"><uni-icons :type="ricon" size="25" :color="titColor" @click="handRbtn"></uni-icons></view></slot></view></view></view></view>
</template>
<script>export default {props: {title: {// 标题文字(默认为空)type: String,default: "",},titColor: {// 标题和返回按钮颜色(默认白色)type: String,default: "#999",},//建议使用background  因为使用backgroundColor,会导致不识别渐变颜色bgcolor: {// 背景颜色type: String,default: "#f4f4f4",},zindex: {// 层级type: Number,default: 1,},isBack: {// 是否显示返回按钮type: Boolean,default: true,},isRbtn: {// 是否显示右边按钮type: Boolean,default: false,},// 图标licon: {// 返回按钮图标type: String,default: "left",},ricon: {// 右边按钮图标type: String,default: "search",},},data() {return {height: '',widtH: '',tops: ''}},created() {// #ifdef  MPuni.getSystemInfo({success: (e) => {// 计算安全高度this.tops = e.statusBarHeight;let custom = uni.getMenuButtonBoundingClientRect();// 标题栏高度this.height = custom.height + (custom.top - e.statusBarHeight) * 2;// 计算标题栏减去 胶囊的宽度this.widtH = e.windowWidth - custom.width - 10}})// #endif},methods: {goBack() {uni.navigateBack({delta: 1 // 返回的页面数})},// 搜索handRbtn() {this.$emit("onRight")}}}
</script><style>.navbar {width: 100%;position: fixed;top: 0px;}.mainbox {display: flex;align-items: center;/* #ifdef   H5 || APP */height: 45px !important;line-height: 45px;/* #endif */}.nav-bar-lf {width: 45px;height: 100%;text-align: center;}.nav-bar-lc {flex: 1;height: 100%;text-align: center;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}.nav-bar-lr {width: 50px;height: 100%;text-align: center;}
</style>

页面中使用

index.vue

<template><view><NavBar  :isBack='true' :isRbtn='true'  title='首页' @onRight="handRight"></NavBar></view>
</template>
<script>//  根据自己的路径import NavBar from "../../../components/NavBar.vue" export default {components: {NavBar},data() {return {}},onLoad() {},methods: {handRight(){console.log("点击右边")}}}
</script><style></style>

带插槽的 ,如果带插槽的 里面样式自己想怎么写怎么写

各端展示如下
在这里插入图片描述
在这里插入图片描述
代码如下 index.vue

<template><view><NavBar  :isBack='true' :isRbtn='true'  title='首页' ><template #lf><view class="item1 item">左边</view></template><template #lc><view class="item2 item">标题部分</view></template><template #lr><view class="item3 item">右边</view></template></NavBar></view>
</template>
<script>import NavBar from "../../../components/NavBar.vue"export default {components: {NavBar},data() {return {}},onLoad() {},methods: {}}
</script><style>
.centermain{flex:1;color:#fff;display: flex;align-items: center;
}
.item{flex: 1;background: pink;
}
.item1{flex: 1;background: pink;
}
.item2{flex: 1;background: greenyellow;
}
.item3{flex: 1;background: salmon;
}
</style>
http://www.hkea.cn/news/754792/

相关文章:

  • 泰安诚信的网站建设b站推广入口2023年
  • 高校网站建设资料库东莞seo推广公司
  • 电子印章手机在线制作软件四川seo整站优化费用
  • 个人风采网站制作外贸网站平台哪个好
  • 沈阳企业建站谷歌推广和seo
  • .la域名做的网站如何快速推广app
  • 广州优化网站建设怎么用手机制作网站
  • 做微网站的第三方学网络营销
  • 湖南做网站的公司有哪些搜索引擎是什么
  • flash网站管理系统seo优化排名易下拉用法
  • 永年网站建设友链互换平台推荐
  • 企业网站的设计公司网络广告营销的典型案例
  • 高校思政主题网站建设的意义关键词歌词任然
  • 哪里做网站比较快2345网址导航下载桌面
  • 广州建设委员会官方网站凡科建站下载
  • 全球做网站的公司排名百度一下你就知道官网
  • 小企业网站价格免费发链接的网站
  • 买了空间和域名 怎么做网站哪家公司网站做得好
  • 网站备案是否关闭衡阳网站建设公司
  • 遂昌建设局网站个人怎么做网站
  • 软件开发和网站建设网络营销的未来6个发展趋势
  • 做网站一年多少钱免费seo网站推广
  • 智通人才网东莞最新招聘信息官网seo是如何做优化的
  • 个人做跨境电商网站百度地图导航手机版免费下载
  • 阿里云注册网站之后怎么做网站百度联盟是什么
  • 动画制作视频河南网站排名优化
  • 网站关键词怎么做排名掌门一对一辅导官网
  • 现在什么网站做推广比较好网页设计需要学什么
  • 个人购物网站 怎么建网络营销包括
  • 有没有做鸭的网站工作室招聘广州网站优化工具