文章 2023-11-23 来自:开发者社区

微信小程序(二十二)子组件调用父组件方法,父组件调用子组件方法

制作了一个自定义组件,底部弹出菜单。显示这个菜单的时候,首先,父组件需要调用子组件的方法,显示子组件。点击子组件的菜单,需要调用父组件的方法进行逻辑处理。1:组件代码如下:popup.wxmlhtml复制代码<!--components/popup/popup.wxml--> <view class="half-screen"> <!--屏幕背景变暗的背景 -...

微信小程序(二十二)子组件调用父组件方法,父组件调用子组件方法
文章 2023-08-02 来自:开发者社区

微信小程序 - 父组件绑定子组件外传事件通信

官方文档 - 组件间通信与事件父组件&lt;!-- 当自定义组件触发“myevent”事件时,调用“onMyEvent”方法 --&gt; &lt;component-tag-name bindmyevent="onMyEvent" /&gt; &lt;!-- 或者可以写成 --&gt; &lt;component-tag-name bind:myevent="onMyEvent" /&gt;P....

文章 2023-04-16 来自:开发者社区

微信小程序:uni-app列表数据渲染子组件修改数据sync/v-model无效的问题

有如下一个列表,将数据循环传递给子组件,实现业务解耦,组件拆分Vue的正常逻辑是,父组件和子组件的数据传递的是一个对象,属于引用传递,可以直接在子组件中修改数据,父组件中也会变化,它们操作的是同一个数据。uni-app子组件中修改 H5正常,转为微信小程序后修改失败解决办法是:将修改的数据以事件的方式传递给父组件,在父组件中修改数据列表 List.vue<template> &...

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

产品推荐

{"cardStyle":"productCardStyle","productCode":"aliyun","productCardInfo":{"productTitle":"10分钟搭建微信小程序","productDescription":"本方案为您介绍如何在阿里云快速部署博客网站,并将网站服务快速应用到微信小程序。","productContentLink":"https://www.aliyun.com/solution/tech-solution/develop-your-wechat-mini-program-in-10-minutes","isDisplayProductIcon":true,"productButton1":{"productButtonText":"方案详情","productButtonLink":"https://www.aliyun.com/solution/tech-solution/develop-your-wechat-mini-program-in-10-minutes"},"productButton2":{"productButtonText":"方案部署","productButtonLink":"https://help.aliyun.com/document_detail/2856534.html"},"productButton3":{"productButtonText":"查看更多技术解决方案","productButtonLink":"https://www.aliyun.com/solution/tech-solution/"},"productPromotionInfoBlock":[{"$id":"0","productPromotionGroupingTitle":"解决方案推荐","productPromotionInfoFirstText":"高效构建企业门户网站","productPromotionInfoFirstLink":"https://www.aliyun.com/solution/tech-solution/build-a-website","productPromotionInfoSecondText":"从 HTTP 到 HTTPS 让网站更安全","productPromotionInfoSecondLink":"https://www.aliyun.com/solution/tech-solution/ssl"}],"isOfficialLogo":false},"activityCardInfo":{"activityTitle":"","activityDescription":"","cardContentBackgroundMode":"LightMode","activityContentBackgroundImageLink":"","activityCardBottomInfoSelect":"activityPromotionInfoBlock"}}

阿里小程序云

阿里小程序云官方技术圈

+关注