From 4e9c8bf515fbabacf47d529788b40e5a2692b908 Mon Sep 17 00:00:00 2001 From: hdx Date: Sat, 7 Oct 2023 16:07:20 +0800 Subject: [PATCH] =?UTF-8?q?feat($callMethod):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=AF=B4=E6=98=8E=E5=92=8C=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/uni-app-x/tutorial/codegap.md | 88 ++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/docs/uni-app-x/tutorial/codegap.md b/docs/uni-app-x/tutorial/codegap.md index 1a58c0b79..ee38ebaf3 100644 --- a/docs/uni-app-x/tutorial/codegap.md +++ b/docs/uni-app-x/tutorial/codegap.md @@ -272,3 +272,91 @@ request({url: 'https://www.example.com/request'} as RequestOptions) ## css使用注意 [详见](uni-app-x/css/README.md) + +## 如何调用组件方法 + +使用 `this.$refs` 获取组件实例,通过 `$callMethod` 调用组件方法 + +`$callMethod` 支持多个参数 + +页面示例代码 `page1.uvue` + +```html + + + +``` + +组件示例代码 `component1.uvue` + +```html + + + +``` -- GitLab