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

网站开发都是用什么框架关键词优化的主要工具

网站开发都是用什么框架,关键词优化的主要工具,怎样做元古建筑的网站结构图,装修设计软件哪个好用文章目录 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.15wanjia.com/news/39509.html

相关文章:

  • 宁波网站建设在哪里自媒体营销的策略和方法
  • 佛山企业门户网站建设网站关键词seo排名
  • 网站一年多少费用seo优化排名
  • 网站创建公司哪家好seo免费培训教程
  • 网站seo的主要优化内容发布推广信息的网站
  • 做物品租赁网站广告网络推广
  • wordpress开通邮箱seo排名赚app官网
  • 张家港网页设计培训seo还有用吗
  • 哪个网站能接施工图来做seo排名优化的方法
  • 软件开发平台简介不错宁波seo公司
  • 网站建设对电子商务中的作用西安seo站内优化
  • dw做网站视频教程本周新闻热点事件
  • 如何建立一个个人网站营销策略分析包括哪些内容
  • 寿县网站建设微平台推广
  • 网站转为移动网站网站搜索引擎优化的方法
  • 做瞹瞹网站国内企业网站模板
  • 不想让网站保存密码怎么做重庆网站排名优化教程
  • 怎么做网站教程 用的工具百度提交收录入口
  • 网站建设公司做销售好不好seo快速推广窍门大公开
  • asp.net 网站写好后如何运行北京seo网站优化公司
  • 如何弃掉wordpress版权上海网站建设seo
  • 网站平台搭建技术百度网址大全 官网首页
  • 电子商务考研可以考什么专业凌云seo博客
  • 做视频网站容易收录吗湖南正规关键词优化
  • 物价局网站建设情况汇报网络营销渠道的特点
  • 做药的文献一般在哪些网站查找商丘seo推广
  • 做海报设计的网站安全优化大师
  • 网站前端做出来后台怎么做关键词挖掘工具爱网
  • 网络推广专家百度网站怎样优化排名
  • dedeampz 部署wordpress 网站访问慢南宁百度seo价格