From c78acce0dc9ce3159ce2e953d30dfea7ac63cd4e Mon Sep 17 00:00:00 2001 From: chenxiaohui Date: Fri, 2 Aug 2024 15:35:46 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20=20utils=20?= =?UTF-8?q?=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vitepress/sidebar/utils.ts | 2 +- docs/src/examples/utils/regex/regex-1.vue | 118 ++++++++++++++++++++++ docs/src/utils/base/regex.md | 19 ++++ 3 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 docs/src/examples/utils/regex/regex-1.vue create mode 100644 docs/src/utils/base/regex.md diff --git a/docs/.vitepress/sidebar/utils.ts b/docs/.vitepress/sidebar/utils.ts index c4650c4fa..ff185288b 100644 --- a/docs/.vitepress/sidebar/utils.ts +++ b/docs/.vitepress/sidebar/utils.ts @@ -21,7 +21,7 @@ export default [ }, { text: '正则表达式', - link: '/numeral' + link: '/regex' }, { text: '事件通讯', diff --git a/docs/src/examples/utils/regex/regex-1.vue b/docs/src/examples/utils/regex/regex-1.vue new file mode 100644 index 000000000..36df38bcb --- /dev/null +++ b/docs/src/examples/utils/regex/regex-1.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/docs/src/utils/base/regex.md b/docs/src/utils/base/regex.md new file mode 100644 index 000000000..b326be89c --- /dev/null +++ b/docs/src/utils/base/regex.md @@ -0,0 +1,19 @@ +# regex 正则表达式 + + +| 函数名 | 描述 | 类型 | 参数 | 返回值 | +| ------------- | -------------- | -------- | ------------------- | --------- | +| isUrl | 检查url | function | `(content: string)` | `boolean` | +| isEmail | 检查邮箱地址 | function | `(content: string)` | `boolean` | +| isIdCardNo | 检查身份证号码 | function | `(content: string)` | `boolean` | +| isMobilePhone | 检查手机号码 | function | `(content: string)` | `boolean` | +| isCarNo | 检查车牌号码 | function | `(content: string)` | `boolean` | + + + + +### 示例 + +:::preview +demo-preview=../../examples/utils/regex/regex-1.vue +:::