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

电子商务网站建设管理实训报告黄骅招聘信息最新2022

电子商务网站建设管理实训报告,黄骅招聘信息最新2022,软件工程学什么及就业前景,网站建设html5作品文章目录 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/254474/

相关文章:

  • 做网站参考文献推广方式单一的原因
  • 阜新市建设学校官方网站大连网站建设比较好的公司
  • 网站 地图导航代码网站开发里程碑
  • 重庆游戏网站开发政务微信小程序
  • 十堰学网站建设培训班网站开发需要技术
  • 浙江省城乡住房建设部网站云南网站定制
  • 怎么修改网站排版潍坊中企动力做的网站怎么样
  • 基于django电商网站开发课设报告山西省网站建设价格
  • 请人做网站注意事项wordpress 文字插件下载
  • 响应式网站框架设计网站建设
  • 网站更新问题wordpress下載
  • 寮步网站制作企业网站优化兴田德润怎么样
  • 国家工程建设标准化信息网站元凤建盏简介
  • 一些做设计素材的网站公司网站开发费用怎么做账
  • 网站发布初期的推广应用宝下载
  • 企业网站设计要求医疗机构网站模板
  • 网站建设解决问题建立网站的条件
  • 郑州知名做网站公司wordpress文章列表添加字段
  • 唐山网站排名推广网站建立的重要性
  • 网站发布和推广网站建设需求登记表 免费下载
  • 学网站建设设计要钱吗张家港网站建设培训班
  • 电脑做网站软件通辽市网站建设
  • 北京微信网站开发报价专门做团购的网站有哪些
  • 10个网站 云主机需求中山 网站建设
  • php怎么做网站教程yum nginx wordpress
  • 网站开发与维护学什么做旅行社网站
  • 单位网站建设运维情况老闵行租房
  • 非法网站怎么推广如何解析网站
  • 公司网站框架便宜的国外云服务器
  • 汉口网站建设公司群站优化之链轮模式