var t = getApp(), o = t.globalData.setting; Component({ properties: { // 这里定义了innerText属性,属性值可以在组件使用时指定 object: { type: Object, value: null, }, nav_list: { type: Array, value: [], }, }, data: { // 这里是一些组件内部数据 strs:null, imghost: o.imghost, someData: {} }, ready: function() { console.log("ready"); var g_id = this.data.object.data; this.pd_navicon(g_id); }, methods: { // 这里是一个自定义方法,判断图片路径,并加载 pd_navicon:function(g_id){ var item={},nav_strs=g_id,th=this; for (var i=0;i', url); getApp().goto(url); } } })