From 3fb9e33890317c2cc1d17712987c7dce7c8f1446 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Tue, 6 Aug 2024 12:40:26 +0800 Subject: [PATCH] =?UTF-8?q?docs(App.uvue):=20=E8=A1=A5=E5=85=85=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E6=96=B9=E6=B3=95=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/collocation/app.md | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/docs/collocation/app.md b/docs/collocation/app.md index 493f30f3..348bb155 100644 --- a/docs/collocation/app.md +++ b/docs/collocation/app.md @@ -153,6 +153,50 @@ globalData是简单的全局变量,其他状态管理方式,可参考文档[全局变量和状态管理](../tutorial/store.md)。 +## 全局方法 +在 `App.uvue methods` 中,可以定义全局方法,这里定义的方法,在项目中可以通过 `getApp().methodName()` 调用, 例如: +```vue + + + + + + + +``` ## 全局样式 在`App.uvue`中,可以定义一些全局通用样式,这里定义的class,每个页面都可以直接使用。 -- GitLab