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 +:::