// commpents/te_navbar/index.js Component({ /** * 组件的属性列表 */ properties: { navbarData: { //navbarData 由父页面传递的数据,变量名字自命名 type: Object, value: { showCapsule: 1, //是否显示胶囊 title: '标题文字', //导航栏 中间的标题} } } }, /** * 组件的初始数据 */ data: { }, /** * 组件的方法列表 */ methods: { onBack() { wx.navigateBack(); }, onGoHome() { wx.reLaunch({ url: '/Pages/index/index', }); }, }, })