index
index wxml
<nav navBG="{ {navBG}}"></nav>
<view>home 页面</view>
index json
"usingComponents": { "nav":"/components/nav/nav" },
"navigationStyle":"custom", // 开启自定义导航头部
"navigationBarTextStyle": "white" // 设置右上角胶囊按钮 为透明
index js
Page({
/**
* 页面的初始数据
*/
data: {
navBG:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.navBG()
},
navBG(){
this.setData({
navBG : '&#