diff --git a/docs/uni-app-x/tutorial/codegap.md b/docs/uni-app-x/tutorial/codegap.md index 1a58c0b799e383a810e351dbdda683979f536597..ee38ebaf326be52c1d703448546fbab177f297fd 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 + + + +```