宁波做公司网站,wordpress文章标题过长,莱芜房产网二手房出售信息,最近实时热点事件注意#xff1a;
在A页面直接使用 uni.$emit(changeCategoryKey, childCategory)传递#xff0c;在B页面使用 uni.$on(changeCategoryKey, (val) {console.log(val, 取值);});只在组件传递有效#xff0c;页面跳转后是无效的
跳转页面使用的传递数据的方法如下…注意
在A页面直接使用 uni.$emit(changeCategoryKey, childCategory)传递在B页面使用 uni.$on(changeCategoryKey, (val) {console.log(val, 取值);});只在组件传递有效页面跳转后是无效的
跳转页面使用的传递数据的方法如下
A页面传递传递
const goVisitList (childCategory, type) {uni.$on(sendCategoryKey, () {uni.$emit(changeCategoryKey, childCategory);});uni.navigateTo({url: /sub-pages/goods/visit-list/index?categoryType${categoryKey},});
};
接收
onLoad(() {uni.$on(changeCategoryKey, (val) {console.log(val, 取值);});uni.$emit(sendCategoryKey);
});