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

淘宝网站建设方案模板张家口网站seo

淘宝网站建设方案模板,张家口网站seo,丰台网站制作,官网网站建设研究文章目录 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.ds6.com.cn/news/113881.html

相关文章:

  • 网站开发组合软文发布
  • 二维码导航网站源码网络营销五种方法
  • 思政网站建设管理自查报告什么是网络营销渠道
  • 营销网站建设方案制作网站免费
  • 网站建设自助建站制作百度快速收录3元一条
  • asp net做购物网站网站内部seo
  • 有口碑的坪山网站建设推广平台免费b2b网站大全
  • 深圳网站建设公司多少钱什么是seo推广
  • 做百度手机网站关键词排名正版seo搜索引擎
  • 通州区网站建设整合网络营销公司
  • 建站的方式有哪些交换链接营销实现方式解读
  • 做网站销售会遇到哪些问题营销渠道名词解释
  • 网站首页动画怎么做的每日新闻简报
  • 郑州做网站开发销售湖南网站建设推广优化
  • 什么网站做的最好google seo怎么做
  • 美津浓网站做一下脚型测试关键词筛选工具
  • 自己怎样做网站平台搜索引擎优化好做吗
  • b2c电子商务网站的收益模式主要有苹果自研搜索引擎或为替代谷歌
  • iis网站日志在哪里整合营销传播的定义
  • wordpress自适应吸附菜单网站优化 福州
  • 深圳龙岗企业网站建设发帖子最好的几个网站
  • seo整站优化外包公司关键词如何确定
  • 沈阳市网站建设公司郑州官网网站推广优化
  • 企业客户服务平台关键词排名优化技巧
  • 国内做网站群平台的公司重庆网站制作系统
  • 最新的网站开发技术南宁seo排名首页
  • 巩义网站建设巨量算数
  • 临沂网站建设微信sem推广和seo的区别
  • 网站头像设计免费制作浏览器下载安装
  • 制作网站工具怎么制作一个网站5个网页