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

济南天桥区网站建设公司wordpress滑块不显示

济南天桥区网站建设公司,wordpress滑块不显示,百度官网,游戏开发专业文章目录 1. 实现效果2. App.vue3. pages.json 配置自定义4. 顶部导航栏 使用 微信小程序自定义 navigationBar 顶部导航栏,兼容适配所有机型 1. 实现效果 2. App.vue 在App.vue 中,设置获取的 StatusBar,CustomBar 高度(实现适配…

文章目录

  • 1. 实现效果
  • 2. App.vue
  • 3. pages.json 配置自定义
  • 4. 顶部导航栏 使用

微信小程序自定义 navigationBar 顶部导航栏,兼容适配所有机型

1. 实现效果

在这里插入图片描述

2. App.vue

  1. 在App.vue 中,设置获取的 StatusBarCustomBar 高度(实现适配高度写法)
  2. uni.getSystemInfo 获取可视区域的高度
  3. wx.getMenuButtonBoundingClientRect() 胶囊按钮位置信息
<script>import Vue from 'vue'export default {onLaunch: function() {uni.getSystemInfo({success: function(e) {// #ifndef MPVue.prototype.StatusBar = e.statusBarHeight;if (e.platform == 'android') {Vue.prototype.CustomBar = e.statusBarHeight + 50;} else {Vue.prototype.CustomBar = e.statusBarHeight + 45;};// #endif// #ifdef MP-WEIXINVue.prototype.StatusBar = e.statusBarHeight;let custom = wx.getMenuButtonBoundingClientRect();Vue.prototype.Custom = custom;Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight + 4;// #endif		// #ifdef MP-ALIPAYVue.prototype.StatusBar = e.statusBarHeight;Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;// #endif}});},onShow: function() {console.log('App Show')},onHide: function() {console.log('App Hide')}}
</script><style lang="scss">
</style>

3. pages.json 配置自定义

"pages": [{"path": "home","style": {"navigationStyle": "custom"}
}]

4. 顶部导航栏 使用

  1. 组件完整代码(CSS 部分 我使用的是 colorUI ,不懂的可以看看写法)
<template><view><view class="cu-custom" :style="[{height:CustomBar + 'px'}]"><view class="cu-bar fixed" :style="style" :class="[bgImage!=''?'none-bg text-white bg-img':'',bgColor]"><view class="action" @tap="BackPage" v-if="isBack"><text class="cuIcon-back"></text><slot name="backText"></slot></view><view class="content" :style="[{top:StatusBar + 'px'}]"><slot name="content"></slot></view><slot name="right"></slot></view></view></view>
</template><script>export default {data() {return {StatusBar: this.StatusBar,CustomBar: this.CustomBar};},name: 'cu-custom',computed: {style() {var StatusBar = this.StatusBar;var CustomBar = this.CustomBar;var bgImage = this.bgImage;var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;if (this.bgImage) {style = `${style}background-image:url(${bgImage});`;}return style}},props: {bgColor: {type: String,default: ''},isBack: {type: [Boolean, String],default: false},bgImage: {type: String,default: ''},},methods: {BackPage() {uni.navigateBack({delta: 1});}}}
</script><style lang="scss" scoped>
</style>
  1. main.js 全局注册顶部导航栏组件
// 此处为引用自定义顶部
import cuCustom from './colorui/components/cu-custom.vue'
Vue.component('cu-custom',cuCustom);
  1. 页面使用导航栏组件
<cu-custom class="navBox" bgColor="bg-gradual-blue" :isBack="true"><block slot="backText">返回</block><block slot="content">首页</block>
</cu-custom>
http://www.yayakq.cn/news/273184/

相关文章:

  • 网站建设与管理是干什么的网站怎么做才能被百度收录
  • 创意设计公司网站无锡做网站公司有哪些
  • 衡阳北京网站建设国网交流建设公司网站
  • 住房和建设部信息网站沧州做家装的公司网站
  • 社交网站开发流程app开发技术路线描述
  • 免费域名注册网站源码wordpress 屏蔽特定国家ip
  • 网站建设最新资讯简单的网页设计模板
  • 保定微网站 建设昆汀的室内设计案例
  • 济南网站建设有限公司小程序登录界面设计
  • 注册网址自媒体seo是什么意思
  • 青岛做网络直播的网站网站推广服务方案
  • 公司网站英文域名在哪查河源网站建设 科技
  • 做的网站怎样更新电子商务平台官网
  • 怎样用微信做购物网站长沙网站建设平台
  • 不花钱的网站建设宁夏中卫市林业生态建设局网站
  • 丽水网站seowordpress使用第三方播放器
  • 设计师网站源码如何找人做网站
  • 网站设计专业国内顶尖设计椅子图片
  • 德阳房产网站建设H5网站建设网站定制开发
  • 网站建设的扩展阶段包括南京网站建设雷仁网络
  • 有什么有什么好的学做饮品的网站企业网站建站策划书
  • 微信认证 网站小程序开发兼职
  • 做网站可以把文字做成图片吗网站后台扫描插件
  • 网站集约化建设背景公司logo设计大全 图片欣赏
  • 网站seo优化心得南阳专业网站建设价格
  • 中小企业网站建设咨询wordpress结构
  • 东莞专业做网站成都高新区国土规划建设局网站
  • 西安做网站 怎样备案部队网站建设总结
  • 东莞网上做公司网站北京建筑培训网
  • 河北区做网站公司经典重庆论坛新闻论坛怎么了