达内it教育官网,津seo快速排名,聊城网站建设哪家便宜,网站建设案例哪家好注意#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);
});