当地建设厅网站,网站焦点图如何美观,怎么自己电脑做网站服务器,中国新闻社是国企还是私企注意#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);
});