docs: ✏️ 添加关于全局反馈方案和最佳实践分享的文档

This commit is contained in:
不如摸鱼去 2025-09-27 19:17:51 +08:00
parent 99581a30be
commit a4d2550fef
6 changed files with 33 additions and 1 deletions

View File

@ -2,6 +2,10 @@
弹出对话框,常用于消息提示、消息确认等,支持函数调用。 弹出对话框,常用于消息提示、消息确认等,支持函数调用。
:::tip 提示
全局调用方案见 [wot-starter](https://starter.wot-ui.cn/guide/feedback.html),支持在路由导航守卫和网络请求拦截器等场景使用的可全局调用的反馈组件。
:::
## Alert 弹框 ## Alert 弹框
alert 弹框只有确定按钮,用于强提醒。 alert 弹框只有确定按钮,用于强提醒。

View File

@ -4,6 +4,8 @@
:::tip 提示 :::tip 提示
`Toast` 自 1.7.0 版本起支持通过 `props` 属性控制组件样式,字段见[props](#props)需要注意的是函数式调用api的`options`优先级高于`props` `Toast` 自 1.7.0 版本起支持通过 `props` 属性控制组件样式,字段见[props](#props)需要注意的是函数式调用api的`options`优先级高于`props`
全局调用方案见 [wot-starter](https://starter.wot-ui.cn/guide/feedback.html),支持在路由导航守卫和网络请求拦截器等场景使用的可全局调用的反馈组件。
::: :::
## 基本用法 ## 基本用法

View File

@ -2,6 +2,10 @@
A dialog box that pops up, commonly used for message prompts, message confirmation, etc., supports function calls. A dialog box that pops up, commonly used for message prompts, message confirmation, etc., supports function calls.
:::tip Note
For global calling solutions, see [wot-starter](https://starter.wot-ui.cn/guide/feedback.html), which supports globally callable feedback components for use in scenarios like route navigation guards and network request interceptors.
:::
## Alert Dialog ## Alert Dialog
Alert dialog only has a confirm button, used for strong reminders. Alert dialog only has a confirm button, used for strong reminders.

View File

@ -2,6 +2,12 @@
A lightweight feedback component that appears in the middle of the page. A lightweight feedback component that appears in the middle of the page.
:::tip Note
`Toast` supports controlling component styles through the `props` attribute since version 1.7.0. See [props](#props) for fields. Note that the `options` priority of functional call API is higher than `props`.
For global calling solutions, see [wot-starter](https://starter.wot-ui.cn/guide/feedback.html), which supports globally callable feedback components for use in scenarios like route navigation guards and network request interceptors.
:::
## Basic Usage ## Basic Usage
The Toast component is a functional component that can be used by calling the `$toast` method on the current instance. The Toast component is a functional component that can be used by calling the `$toast` method on the current instance.

View File

@ -6,6 +6,9 @@ This section introduces some **common problems** encountered during development
Currently supports WeChat Mini Program, Alipay Mini Program, DingTalk Mini Program, H5, APP, and other platforms. Currently supports WeChat Mini Program, Alipay Mini Program, DingTalk Mini Program, H5, APP, and other platforms.
## Are there any best practice sharing?
Yes, you can follow my WeChat public account "不如摸鱼去", or visit my blog [不如摸鱼去](https://blog.wot-ui.cn/), sharing countless dry goods, waiting for you to see.
## Does the component library provide components that can be imported individually? ## Does the component library provide components that can be imported individually?
Currently, no. First, the plugin market lacks CI/CD tools, making automated publishing impossible. Maintaining a set of individually importable components is time and effort-consuming. Secondly, the installation methods provided by the component library can already achieve on-demand importing, so there's no need to provide individually importable components. Currently, no. First, the plugin market lacks CI/CD tools, making automated publishing impossible. Maintaining a set of individually importable components is time and effort-consuming. Secondly, the installation methods provided by the component library can already achieve on-demand importing, so there's no need to provide individually importable components.
@ -198,3 +201,10 @@ First, check if the usage is correct. The `uni-app` platform doesn't support glo
``` ```
The functional calls of `Message` and `Toast` are implemented based on `provide/inject`, so your calls must be made within `setup`. The functional calls of `Message` and `Toast` are implemented based on `provide/inject`, so your calls must be made within `setup`.
## Why are multiple messageBoxes popping up?
Check if the page with multiple `messageBox` popups has multiple `<wd-message-box></wd-message-box>` tags with the same `selector` or no `selector` (including components used in the current page). The same applies to `toast`. When using components like `messageBox` in child components, you need to specify a `selector` and ensure the `selector` is unique.
## How to call Toast, Message, Loading globally?
For global calling solutions, see [wot-starter](https://starter.wot-ui.cn/guide/feedback.html), which supports globally callable feedback components for use in scenarios like route navigation guards and network request interceptors.

View File

@ -6,6 +6,9 @@
目前支持 微信小程序、支付宝小程序、钉钉小程序、H5、APP 等平台。 目前支持 微信小程序、支付宝小程序、钉钉小程序、H5、APP 等平台。
## 有没有最佳实践分享?
有,可以关注我的公众号「不如摸鱼去」,也可以访问我的博客[不如摸鱼去](https://blog.wot-ui.cn/),分享无数干货,等你来看。
## 组件库有没有提供可以单独引入的组件? ## 组件库有没有提供可以单独引入的组件?
目前是没有的,首先在插件市场缺少`CI/CD`工具,无法实现自动化发布,维护一套单独引入的组件费时费力,其次组件库提供的安装方式均可以实现按需引入,所以是无需提供单独引入的组件的。 目前是没有的,首先在插件市场缺少`CI/CD`工具,无法实现自动化发布,维护一套单独引入的组件费时费力,其次组件库提供的安装方式均可以实现按需引入,所以是无需提供单独引入的组件的。
@ -313,6 +316,9 @@ function handleOpened() {
## 为何messageBox弹出了多个 ## 为何messageBox弹出了多个
检查一下弹出多个`messageBox`的页面是否存在多个相同`selector`或无`selector``<wd-message-box></wd-message-box>`标签(当前页面包括页面中使用的组件)。`toast`亦是同理,在子组件中使用`messageBox`等组件需要指定`selector`并确保`selector`唯一。 检查一下弹出多个`messageBox`的页面是否存在多个相同`selector`或无`selector``<wd-message-box></wd-message-box>`标签(当前页面包括页面中使用的组件)。`toast`亦是同理,在子组件中使用`messageBox`等组件需要指定`selector`并确保`selector`唯一。
## Toast、Message、Loading 等如何全局调用?
全局调用方案见 [wot-starter](https://starter.wot-ui.cn/guide/feedback.html),支持在路由导航守卫和网络请求拦截器等场景使用的可全局调用的反馈组件。
## 如何快速解决你的问题? ## 如何快速解决你的问题?