GithubHelp home page GithubHelp logo

jesse2134 / uniapp_navigation_custom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from strugglerx/uniapp_navigation_custom

0.0 1.0 0.0 179 KB

uni-app 自定义状态栏组件

Vue 78.06% JavaScript 1.42% CSS 20.52%

uniapp_navigation_custom's Introduction

uniapp 小程序自定义导航栏

微信小程序自定义导航栏组件,ios与android端都可以和右边的胶囊对齐,使用环境为 uni-app

如何获取

github仓库: https://github.com/strugglerx/uniapp_navigation_custom

props

参数 描述 类型 默认值
config 配置 object {title:"",bgcolor:"",type:2,linear:false,transparent:false,fontcolor:"#000",menuIcon:"",menuText:""}
scrollTop 滑动高度 number 0
scrollMaxHeight 滑动最高高度 number 288

如何使用

*.vue

<navigation-custom :config="config" :scrollTop="scrollTop" @customConduct="customConduct" :scrollMaxHeight="scrollMaxHeight"/>
	import navigationCustom from "../../components/navigation-custom"
	export default {
		data() {
			return {
				config:{
					title:"我是标题", //title
					bgcolor:"#c1a379", //背景颜色
					// fontcolor:"red", //文字颜色,默认白色
					type:2, //type 1,3胶囊 2,4无胶囊模式
					transparent:true, //是否背景透明 默认白色
					linear:true, //是为开启下滑渐变
					share:true, //是否将主页按钮显示为分享按钮
					// menuIcon:"../static/icon/back_.png", 当type为3或者4的时候左边的icon文件位置,注意位置与当前页面不一样
					// menuText:"返回", 当type为3或4的时候icon右边的文字
				},
				scrollTop:0 ,// 当linear为true的时候需要通过onpagescroll传递参数
				scrollMaxHeight:200 //滑动的高度限制,超过这个高度即背景全部显示
			}
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		},
		components:{
			navigationCustom
		},
		methods: {
			//当config type 为 4或者3 的时候 自定义methods
			customConduct(){
				console.log("ssssss")
			}
		}
	}

实际效果

android ios type=3

反馈问题

如在使用中发现bug或有优化的建议和意见,请发邮件 [email protected] 或在 gitHub 上反馈。

更新日志

2019.6.3 v0.0.2 返回主页修改为switchTab

2019.6.1 v0.0.1 创建本插件

uniapp_navigation_custom's People

Contributors

strugglerx avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.