From 0f626d0688ca2dc8661ab02af9236cda45cb7170 Mon Sep 17 00:00:00 2001
From: Kagol
-### Install and use`TinyVue`Components
+## Install and use`TinyVue`Components
Run the following command to install the`Vue 3.0`version of`TinyVue`Component library:
diff --git a/examples/sites/demos/pc/webdoc/develop-demo.md b/examples/sites/demos/pc/webdoc/develop-demo.md
index 8917c3248f..d4ffcdde5a 100644
--- a/examples/sites/demos/pc/webdoc/develop-demo.md
+++ b/examples/sites/demos/pc/webdoc/develop-demo.md
@@ -1,10 +1,10 @@
-## 开发示例
+# 开发示例
本文以 [Vite](https://cn.vitejs.dev/) 工程为例,展示如何使用 `TinyVue` 组件。
-### 搭建 Vite 项目
+## 搭建 Vite 项目
使用以下命令创建 `Vite` 工程:
@@ -30,7 +30,7 @@ npm run dev
-### 安装并使用 `TinyVue` 组件
+## 安装并使用 `TinyVue` 组件
执行以下命令安装 `Vue 3.0` 版本的 `TinyVue` 组件库 :
diff --git a/examples/sites/demos/pc/webdoc/envpreparation-open-en.md b/examples/sites/demos/pc/webdoc/envpreparation-open-en.md
index 08622994e7..be8ec0b076 100644
--- a/examples/sites/demos/pc/webdoc/envpreparation-open-en.md
+++ b/examples/sites/demos/pc/webdoc/envpreparation-open-en.md
@@ -1,10 +1,10 @@
-## Environment Preparation
+# Environment Preparation
TinyVue is a`Vue`UI component library, which can also support`Vue 2.0`and`Vue 3.0`.
Browser compatibility`TinyVue`The latest versions of mainstream browsers are supported: Chrome, Edge, Firefox, Opera, and Safari. No longer supported`Internet Explorer`.
-### Installing Node.js
+## Installing Node.js
Recommended Installation`v16.13.0`version, if the local`Node.js`, run the following command to check whether the version is correct:
@@ -12,7 +12,7 @@ Recommended Installation`v16.13.0`version, if the local`Node.js`, run the follow
node -v
```
-### Installing Yarn
+## Installing Yarn
management`npm`There are two main tools for the package. One is the installation.`Node.js`When it comes`npm`, the other is the faster`yarn`, run the following command to install:
diff --git a/examples/sites/demos/pc/webdoc/envpreparation-open.md b/examples/sites/demos/pc/webdoc/envpreparation-open.md
index 04e6f73d76..caa4d9e2ec 100644
--- a/examples/sites/demos/pc/webdoc/envpreparation-open.md
+++ b/examples/sites/demos/pc/webdoc/envpreparation-open.md
@@ -1,10 +1,10 @@
-## 环境准备
+# 环境准备
TinyVue 是一个基于 `Vue` 的 UI 组件库,可以同时支持 `Vue 2.0` 和 `Vue 3.0`。
浏览器兼容性 `TinyVue` 支持主流浏览器的最新版本:Chrome、Edge、Firefox、Opera、Safari 不支持 IE 浏览器
-### 安装 Node.js
+## 安装 Node.js
推荐安装 `v16.13.0` 及以上版本,如果本地已经安装了 `Node.js`,可以通过以下命令检查版本是否正确:
@@ -12,7 +12,7 @@ TinyVue 是一个基于 `Vue` 的 UI 组件库,可以同时支持 `Vue 2.0`
node -v
```
-### 安装 Yarn
+## 安装 Yarn
管理 `npm` 包的工具主要有两种,一种是安装 `Node.js` 时自带的 `npm` ,另一种是速度更快的 `yarn`,通过以下命令安装:
diff --git a/examples/sites/demos/pc/webdoc/faq-en.md b/examples/sites/demos/pc/webdoc/faq-en.md
index 088e25ddc4..a30586a11b 100644
--- a/examples/sites/demos/pc/webdoc/faq-en.md
+++ b/examples/sites/demos/pc/webdoc/faq-en.md
@@ -1,6 +1,6 @@
-## FAQ
+# FAQ
-### 1、Popup element misaligned and flipped in wujie micro front-end
+## 1、Popup element misaligned and flipped in wujie micro front-end
_Reason:_ The popup element has a boundary detection logic, and in sub applications, the width and height of 'window' may be much smaller than that of the viewport,
therefore, it can misjudge boundaries, leading to issues such as flipping and misalignment.
diff --git a/examples/sites/demos/pc/webdoc/faq.md b/examples/sites/demos/pc/webdoc/faq.md
index b1fa18cfa6..9aef75100d 100644
--- a/examples/sites/demos/pc/webdoc/faq.md
+++ b/examples/sites/demos/pc/webdoc/faq.md
@@ -1,6 +1,6 @@
-## 常见问题
+# 常见问题
-### 1、弹出元素在无界微前端中发生错位、翻转
+## 1、弹出元素在无界微前端中发生错位、翻转
_原因:_ 弹出类的元素,存在一个边界检测逻辑,在子应用中,`window` 的宽高可能会比视口小得多,
因此会错误判断边界,导致翻转和错位等问题。
diff --git a/examples/sites/demos/pc/webdoc/form-valid-en.md b/examples/sites/demos/pc/webdoc/form-valid-en.md
index 97e899ced0..a4f07c5e71 100644
--- a/examples/sites/demos/pc/webdoc/form-valid-en.md
+++ b/examples/sites/demos/pc/webdoc/form-valid-en.md
@@ -1,13 +1,13 @@
-## Form Verification Configuration
+# Form Verification Configuration
Form validation is based on`async-validator`Encapsulated, mainly used`validate`Function and`rules`Configuration rules of the.
-### API
+## API
-#### validate
+### validate
When submitting a form, the system verifies the fields to be verified in the entire form to obtain the verification result. The following is an example:
@@ -21,11 +21,11 @@ Parameter description:
- `error`: Array type, including fields that do not pass the verification.
-### Rules
+## Rules
Used to set the verification rules for each field to be verified in the form, including the verification type of each field, whether it is mandatory, and the prompt information indicating that the verification fails.
-#### type
+### type
through`type`Set the verification type of the field to be verified. With this function, we can verify some specific fields without writing regular rules and making judgments. The following is an example:
@@ -67,7 +67,7 @@ The values that can be set are as follows:
- `any`: any type
-#### required
+### required
`required`The attribute value of is of the Boolean type, which is used to set whether a field is mandatory, that is, non-empty verification.
@@ -75,7 +75,7 @@ The values that can be set are as follows:
- `false`: default value, indicating that the field is not mandatory. The label does not contain red asterisks \*.
-#### pattern
+### pattern
Configure the regular expression used to verify the field. The following is an example:
@@ -85,7 +85,7 @@ rules: {
}
```
-#### min
+### min
For the string and array types, the lengths are compared. For the number type, the number cannot be less than`min`. An example is as follows:
@@ -95,7 +95,7 @@ rules: {
}
```
-#### max
+### max
For the string and array types, the lengths are compared. For the number type, the number cannot be greater than`max`. An example of the use is as follows:
@@ -105,7 +105,7 @@ rules: {
}
```
-#### len
+### len
To verify the exact length of the field, specify`len`Property. For string and array types, the length property is compared. For type number, this property indicates an exact match for that number, that is, it can only be strictly equal to`len`. If`len`Attribute vs.`min`and`max`Attributes are used together, then`len`Preferred. Examples of usage are as follows:
@@ -115,7 +115,7 @@ rules: {
}
```
-#### trigger
+### trigger
Configure the way to trigger the verification rules through `trigger`. When it is `change`, the verification is triggered when the input box value changes. When it is `blur`,
the verification is triggered after the input box value is out of focus. Can be set to an array `['change', 'blur']` to trigger both scenarios. The default is to trigger both scenarios.
@@ -137,7 +137,7 @@ The configurable values are as follows:
- `change`: The verification is triggered when the value in the input box changes.
-#### enum
+### enum
Enumerated value validation, which verifies whether the value of the field is in`enum`Attribute configuration array`['admin', 'user', 'guest']`Medium. For example:
@@ -147,7 +147,7 @@ rules: {
}
````
-#### whitespace
+### whitespace
Verify that mandatory fields have only spaces. Mandatory fields that contain only blanks are generally considered an error. To treat a string consisting only of spaces as an error, you can set`whitespace`for`true`If this parameter is not configured, the input value of all spaces is valid.
@@ -157,7 +157,7 @@ rules: {
}
```
-#### fields
+### fields
deep rule. If you need to validate deep object properties, you can assign nested rules to the rule's`fields`Attribute to validate an object or array validation rule. Note that if you do not specify on the parent rule`required`Property, the field is not declared to be fully valid on the source object, and the deep validation rule will not be enforced because there are no verifiable objects. For example:
@@ -192,7 +192,7 @@ rules: {
}
```
-#### defaultField
+### defaultField
`defaultField`Attributes can be used with array or object types to validate all values of the container. It can be an object or an array containing validation rules. For example:
@@ -205,7 +205,7 @@ rules: {
}
```
-#### transform
+### transform
Sometimes it is necessary to convert values before validation to force or in some way clean them up.`transform`, add a feature to the validation rule. Before validation, the attribute is converted and then reassigned to the source object to change the value of the attribute. For example, the space entered by the user is removed.
@@ -222,7 +222,7 @@ rules: {
}
```
-#### messages
+### messages
This parameter is used to configure the message displayed when field verification fails. Internationalization is supported.
@@ -250,7 +250,7 @@ rules: {
}
```
-#### validator
+### validator
By`validator`The options are customized for a field.`callback`Must be invoked.
@@ -278,7 +278,7 @@ rules: {
}
```
-#### asyncValidator
+### asyncValidator
By`asyncValidator`The option is to perform custom asynchronous validation for a field.`callback`Must be invoked.
diff --git a/examples/sites/demos/pc/webdoc/form-valid.md b/examples/sites/demos/pc/webdoc/form-valid.md
index 261329ad7d..5cee784a41 100644
--- a/examples/sites/demos/pc/webdoc/form-valid.md
+++ b/examples/sites/demos/pc/webdoc/form-valid.md
@@ -1,13 +1,13 @@
-## 表单校验配置
+# 表单校验配置
表单校验是基于 `async-validator` 封装的,主要用到 `validate` 函数和 `rules` 的配置规则。
-### API
+## API
-#### validate
+### validate
常用于提交表单的时候,对整个表单需校验字段进行校验,得到校验结果,使用示例如下所示:
@@ -21,11 +21,11 @@ this.$refs[formName].validate((valid, error) => {})
- `error`:Array 类型,包含校验不通过的字段。
-### Rules
+## Rules
用于设置表单每个需校验字段的校验规则,可设置每个字段的校验类型,是否必填,校验不成功的提示信息等。
-#### type
+### type
通过 `type` 设置需校验字段的校验类型,使用这个,我们就可以对一些特定的字段进行校验,而不用再像以前一样写正则,做判断。使用示例如下所示:
@@ -67,7 +67,7 @@ rules: {
- `any`:任意类型
-#### required
+### required
`required` 的属性值为 Boolean 类型,用于设置字段是否为必填项,即非空验证。
@@ -75,7 +75,7 @@ rules: {
- `false`:默认值,表示该字段不是必填项,label 不会带红色 \* 号
-#### pattern
+### pattern
配置用于校验该字段的正则表达式。使用示例如下所示:
@@ -85,7 +85,7 @@ rules: {
}
```
-#### min
+### min
对于 string 和 array 类型,将对长度进行比较,对于 number 类型,数字不能小于 `min`。使用示例如下所示:
@@ -95,7 +95,7 @@ rules: {
}
```
-#### max
+### max
对于 string 和 array 类型,将对长度进行比较,对于 number 类型,数字不能大于 `max`。使用示例如下所示:
@@ -105,7 +105,7 @@ rules: {
}
```
-#### len
+### len
要验证字段的确切长度,请指定 `len` 属性。对于 string 和 array 类型,将对 length 属性进行比较。对于 number 类型,此属性表示该数字的精确匹配,即,它只能严格等于 `len`。如果 `len` 属性与 `min` 和 `max` 属性一起使用,则 `len` 优先。使用示例如下所示:
@@ -115,7 +115,7 @@ rules: {
}
```
-#### trigger
+### trigger
通过 `trigger` 配置触发校验规则的方式,为 `change` 时,当输入框值改变即触发校验,为 `blur` 时则失焦后触发校验。可设置成数组 `['change', 'blur']` 两种场景都触发,默认为两种场景都触发。
如果如果仅在主动调用校验方式时触发,可设置为空数组 `[]`。使用示例如下所示:
@@ -134,7 +134,7 @@ rules: {
- `change`:当输入框值改变即触发校验
-#### enum
+### enum
枚举值验证,验证字段的值是否在 `enum` 属性配置的数组 `['admin', 'user', 'guest']` 中。例如:
@@ -144,7 +144,7 @@ rules: {
}
```
-#### whitespace
+### whitespace
验证必填字段是否只有空格。通常将只包含空白的必填字段视为错误。若要将仅由空格组成的字符串视为错误,则可设置 `whitespace` 为 `true` ,如果没有该配置,则全空格的输入值也是有效的。
@@ -154,7 +154,7 @@ rules: {
}
```
-#### fields
+### fields
深层规则。如果需要验证深层对象属性,可以通过将嵌套规则分配给规则的 `fields` 属性来验证 object 或 array 类型的验证规则。请注意,如果不在父规则上指定 `required` 属性,则不在源对象上声明字段是完全有效的,并且深度验证规则将不会执行,因为没有任何可验证的对象。例如:
@@ -189,7 +189,7 @@ rules: {
}
```
-#### defaultField
+### defaultField
`defaultField` 属性可与 array 或 object 类型一起使用,以验证容器的所有值。它可以是包含验证规则的 object 或 array。例如:
@@ -202,7 +202,7 @@ rules: {
}
```
-#### transform
+### transform
有时有必要在验证之前转换值,以强制或以某种方式对其进行清理。为此 `transform` ,向验证规则添加一个功能。在验证之前,先转换属性,然后将其重新分配给源对象,以更改该属性的值。使用场景比如:去除用户输入的空格。
@@ -219,7 +219,7 @@ rules: {
}
```
-#### messages
+### messages
用于配置字段校验不成功时的提示信息,支持国际化。
@@ -247,7 +247,7 @@ rules: {
}
```
-#### validator
+### validator
通过 `validator` 选项为某个字段进行自定义校验,校验方法中 `callback` 必须被调用。
@@ -275,7 +275,7 @@ rules: {
}
```
-#### asyncValidator
+### asyncValidator
通过 `asyncValidator` 选项为某个字段进行自定义异步校验,校验方法中 `callback` 必须被调用。
diff --git a/examples/sites/demos/pc/webdoc/i18n-en.md b/examples/sites/demos/pc/webdoc/i18n-en.md
index ff45096da6..7b264d742b 100644
--- a/examples/sites/demos/pc/webdoc/i18n-en.md
+++ b/examples/sites/demos/pc/webdoc/i18n-en.md
@@ -1,8 +1,8 @@
-## Internationalization
+# Internationalization
`TinyVue` uses the official internationalization plug-in of `Vue`. You need to install the `vue-i18n` plug-in.
-### Vue 3.0 internationalization configuration
+## Vue 3.0 internationalization configuration
Step 1: You are advised to install the `vue-i18n` plug-in of the `^ 9.1.6' version by running the following command:
@@ -48,7 +48,7 @@ app.use(initI18n({ locale: 'zhCN' }))
app.use(router).mount('#app')
```
-### Vue 2.0 internationalization configuration
+## Vue 2.0 internationalization configuration
Step 1: You are advised to install the `vue-i18n` plug-in of the `8.15. 0` version by running the following command:
diff --git a/examples/sites/demos/pc/webdoc/i18n.md b/examples/sites/demos/pc/webdoc/i18n.md
index 425379b7cb..76f3bd9a7c 100644
--- a/examples/sites/demos/pc/webdoc/i18n.md
+++ b/examples/sites/demos/pc/webdoc/i18n.md
@@ -1,8 +1,8 @@
-## 国际化
+# 国际化
`TinyVue` 使用 `Vue` 的官方国际化插件,需要安装 `vue-i18n` 插件。
-### Vue 3.0 版本国际化配置
+## Vue 3.0 版本国际化配置
步骤一、推荐安装 `^9.1.6` 版本的`vue-i18n` 插件,通过以下命令安装:
@@ -50,7 +50,7 @@ app.use(i18n)
app.use(router).mount('#app')
```
-### Vue 2.0 版本国际化配置
+## Vue 2.0 版本国际化配置
步骤一、推荐安装 `8.15.0` 版本的`vue-i18n` 插件,通过以下命令安装:
@@ -101,7 +101,7 @@ new Vue({
}).$mount('#app')
```
-### 自定义国际化配置
+## 自定义国际化配置
如果需要自定义国际化配置可以修改 `src/i18n/index.js` 如下以 `Vue 3.0` 版本为例(`Vue 2.0` 版本同理):
@@ -132,7 +132,7 @@ export default (i18n) =>
})
```
-### 语言切换
+## 语言切换
配置国际化插件之后,可以通过以下方式在模板中使用国际化词条。
diff --git a/examples/sites/demos/pc/webdoc/import-components-en.md b/examples/sites/demos/pc/webdoc/import-components-en.md
index fca471de8d..9f1f2cad65 100644
--- a/examples/sites/demos/pc/webdoc/import-components-en.md
+++ b/examples/sites/demos/pc/webdoc/import-components-en.md
@@ -1,10 +1,10 @@
-## Introduction Components
+# Introduction Components
`TinyVue` supports automatic import, multiple component import, single component import, and complete import.
-### Auto import (recommended)
+## Auto import (recommended)
First, you need to install the plugin `@opentiny/unplugin-tiny-vue`.
@@ -42,7 +42,7 @@ This way, you can directly use TinyVue components in your project. These compone
For more information about automatic on-demand imports, please refer to [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) and [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import).
-### Multi-component introduction
+## Multi-component introduction
@@ -73,7 +73,7 @@ Multi-component reference is from the dependency package.`@opentiny/vue`Multiple
```
-### Single component introduction
+## Single component introduction
`TinyVue`Each component can be installed and used independently. That is, only the dependency of a single component is installed and referenced independently.
@@ -108,7 +108,7 @@ Use in Pages`Button`and`Alert`An example of a component is as follows:
```
-### Full introduction (not recommended)
+## Full introduction (not recommended)
Once the component is fully introduced, you do not need to import the component and register it locally on every page.`main.js`Global registration in, but as a result, it loses`tree-shaking`Capabilities. Redundant code is available after packaging.
diff --git a/examples/sites/demos/pc/webdoc/import-components.md b/examples/sites/demos/pc/webdoc/import-components.md
index d21fd7395e..5c848f1331 100644
--- a/examples/sites/demos/pc/webdoc/import-components.md
+++ b/examples/sites/demos/pc/webdoc/import-components.md
@@ -1,10 +1,10 @@
-## 引入组件
+# 引入组件
`TinyVue` 支持自动导入、多组件引入、单组件引入以及完整引入四种方式。
-### 自动导入(推荐)
+## 自动导入(推荐)
首先你需要安装 `@opentiny/unplugin-tiny-vue` 这款插件。
@@ -82,7 +82,7 @@ module.exports = defineConfig({
想了解更多自动按需导入的信息,请参考:[unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) 和 [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import)。
-### 多组件引入
+## 多组件引入
@@ -113,7 +113,7 @@ module.exports = defineConfig({
```
-### `vite` 工程多组件引入按需加载和打包配置方法
+## `vite` 工程多组件引入按需加载和打包配置方法
通过配置 `@opentiny/vue-vite-import` 插件可以按需只打包 pc 或者移动的组件,减少组件库打包后的体积。
@@ -158,7 +158,7 @@ export default {
}
```
-#### 温馨提示
+### 温馨提示
因为 `pnpm` 工程的特点之一是:项目中显示引入的依赖需要提前在 `package.json` 中声明(防止幽灵依赖),所以在 `pnpm` 工程使用该插件时需要在 `package.json` 中声明项目用到的每一个 `TinyVue` 组件依赖(`TinyVue` 每个组件都是一个 `npm` 包)。依赖声明可以参考以下配置:
@@ -173,7 +173,7 @@ export default {
}
```
-### 单组件引入
+## 单组件引入
`TinyVue` 每个组件都可以独立安装、独立使用,即只安装单个组件的依赖并单独引用该组件。
@@ -208,7 +208,7 @@ npm install @opentiny/vue-button @opentiny/vue-alert
```
-### 完整引入(不推荐)
+## 完整引入(不推荐)
完整引入组件后,就不需每个页面都 import 组件和局部注册,只需在 `main.js` 中全局注册,但因此会失去 `tree-shaking` 的能力,打包后会有冗余代码。
diff --git a/examples/sites/demos/pc/webdoc/installation-en.md b/examples/sites/demos/pc/webdoc/installation-en.md
index 1cbceaaa1d..3f8c8cf2f6 100644
--- a/examples/sites/demos/pc/webdoc/installation-en.md
+++ b/examples/sites/demos/pc/webdoc/installation-en.md
@@ -1,6 +1,6 @@
-## Installation
+# Installation
`TinyVue`The component library also supports`Vue 2.0`and`Vue 3.0`Framework, unified dependency package:`@opentiny/vue`, please install different versions to fit your project according to the table below:
@@ -13,7 +13,7 @@
For a long time, TinyVue only supports Vue 2.6.14. Starting from TinyVue 2.11.0, the project of Vue 2.7+ is also supported. Make sure that you have installed the correct Vue 2.x dependency.
-### New Project Configuration
+## New Project Configuration
In the root directory of the project, open the console and execute the following command to`Vue 3.0`Project Installation`TinyVue`Component library:
@@ -57,7 +57,7 @@ For example, "@opentiny/vue": "~3.12.0
.
@opentiny/vue
supports multiple modes. If your project is not a mobile project, you can declare the value of TINY_MODE
in process.env
in the above configuration code. In order to make the project during construction, the mobile side code can be shaken off and the volume of the packaged product can be optimized. For example, 'process.env': {... env,TINY_MODE:'pc'}
.