Commit 5ce3a187 by Vben Committed by GitHub

docs: update docs (#4466)

* chore: fixed known issues with form components

* docs: add vben form doc
1 parent dac80703
Showing 36 changed files with 1394 additions and 33 deletions
...@@ -27,13 +27,13 @@ import { ...@@ -27,13 +27,13 @@ import {
Select, Select,
Space, Space,
Switch, Switch,
Textarea,
TimePicker, TimePicker,
TreeSelect, TreeSelect,
Upload, Upload,
} from 'ant-design-vue'; } from 'ant-design-vue';
// 业务表单组件适配 // 这里需要自行根据业务组件库进行适配,需要用到的组件都需要在这里类型说明
export type FormComponentType = export type FormComponentType =
| 'AutoComplete' | 'AutoComplete'
| 'Checkbox' | 'Checkbox'
...@@ -51,6 +51,7 @@ export type FormComponentType = ...@@ -51,6 +51,7 @@ export type FormComponentType =
| 'Select' | 'Select'
| 'Space' | 'Space'
| 'Switch' | 'Switch'
| 'Textarea'
| 'TimePicker' | 'TimePicker'
| 'TreeSelect' | 'TreeSelect'
| 'Upload' | 'Upload'
...@@ -83,12 +84,16 @@ setupVbenForm<FormComponentType>({ ...@@ -83,12 +84,16 @@ setupVbenForm<FormComponentType>({
Select, Select,
Space, Space,
Switch, Switch,
Textarea,
TimePicker, TimePicker,
TreeSelect, TreeSelect,
Upload, Upload,
}, },
config: { config: {
// ant design vue组件库默认都是 v-model:value
baseModelPropName: 'value', baseModelPropName: 'value',
// 一些组件是 v-model:checked 或者 v-model:fileList
modelPropNameMap: { modelPropNameMap: {
Checkbox: 'checked', Checkbox: 'checked',
Radio: 'checked', Radio: 'checked',
...@@ -97,12 +102,14 @@ setupVbenForm<FormComponentType>({ ...@@ -97,12 +102,14 @@ setupVbenForm<FormComponentType>({
}, },
}, },
defineRules: { defineRules: {
// 输入项目必填国际化适配
required: (value, _params, ctx) => { required: (value, _params, ctx) => {
if ((!value && value !== 0) || value.length === 0) { if (value === undefined || value === null || value.length === 0) {
return $t('formRules.required', [ctx.label]); return $t('formRules.required', [ctx.label]);
} }
return true; return true;
}, },
// 选择项目必填国际化适配
selectRequired: (value, _params, ctx) => { selectRequired: (value, _params, ctx) => {
if (value === undefined || value === null) { if (value === undefined || value === null) {
return $t('formRules.selectRequired', [ctx.label]); return $t('formRules.selectRequired', [ctx.label]);
......
...@@ -73,7 +73,7 @@ setupVbenForm<FormComponentType>({ ...@@ -73,7 +73,7 @@ setupVbenForm<FormComponentType>({
}, },
defineRules: { defineRules: {
required: (value, _params, ctx) => { required: (value, _params, ctx) => {
if ((!value && value !== 0) || value.length === 0) { if (value === undefined || value === null || value.length === 0) {
return $t('formRules.required', [ctx.label]); return $t('formRules.required', [ctx.label]);
} }
return true; return true;
......
...@@ -82,7 +82,7 @@ setupVbenForm<FormComponentType>({ ...@@ -82,7 +82,7 @@ setupVbenForm<FormComponentType>({
}, },
defineRules: { defineRules: {
required: (value, _params, ctx) => { required: (value, _params, ctx) => {
if ((!value && value !== 0) || value.length === 0) { if (value === undefined || value === null || value.length === 0) {
return $t('formRules.required', [ctx.label]); return $t('formRules.required', [ctx.label]);
} }
return true; return true;
......
...@@ -24,6 +24,7 @@ const parsedFiles = computed(() => { ...@@ -24,6 +24,7 @@ const parsedFiles = computed(() => {
class="not-prose relative w-full overflow-x-auto rounded-t-lg px-4 py-6" class="not-prose relative w-full overflow-x-auto rounded-t-lg px-4 py-6"
> >
<div class="flex w-full max-w-[700px] px-2"> <div class="flex w-full max-w-[700px] px-2">
<ClientOnly>
<slot v-if="parsedFiles.length > 0"></slot> <slot v-if="parsedFiles.length > 0"></slot>
<div v-else class="text-destructive text-sm"> <div v-else class="text-destructive text-sm">
<span class="bg-destructive text-foreground rounded-sm px-1 py-1"> <span class="bg-destructive text-foreground rounded-sm px-1 py-1">
...@@ -32,6 +33,7 @@ const parsedFiles = computed(() => { ...@@ -32,6 +33,7 @@ const parsedFiles = computed(() => {
The preview directory does not exist. Please check the 'dir' The preview directory does not exist. Please check the 'dir'
parameter. parameter.
</div> </div>
</ClientOnly>
</div> </div>
</div> </div>
<PreviewGroup v-if="parsedFiles.length > 0" :files="parsedFiles"> <PreviewGroup v-if="parsedFiles.length > 0" :files="parsedFiles">
......
...@@ -154,15 +154,19 @@ function sidebarComponents(): DefaultTheme.SidebarItem[] { ...@@ -154,15 +154,19 @@ function sidebarComponents(): DefaultTheme.SidebarItem[] {
items: [ items: [
{ {
link: 'common-ui/vben-modal', link: 'common-ui/vben-modal',
text: 'Vben Modal 模态框', text: 'Modal 模态框',
}, },
{ {
link: 'common-ui/vben-drawer', link: 'common-ui/vben-drawer',
text: 'Vben Drawer 抽屉', text: 'Drawer 抽屉',
}, },
{ {
link: 'common-ui/vben-form', link: 'common-ui/vben-form',
text: 'Vben Form 表单', text: 'Form 表单',
},
{
link: 'common-ui/vben-count-to-animator',
text: 'CountToAnimator 数字动画',
}, },
], ],
}, },
......
<script lang="ts" setup> <script lang="ts" setup>
import { nextTick, onMounted, watch } from 'vue'; import {
computed,
nextTick,
onBeforeUnmount,
onMounted,
ref,
watch,
} from 'vue';
// import { useAntdDesignTokens } from '@vben/hooks';
// import { initPreferences } from '@vben/preferences';
import { ConfigProvider, theme } from 'ant-design-vue';
import mediumZoom from 'medium-zoom'; import mediumZoom from 'medium-zoom';
import { useRoute } from 'vitepress'; import { useRoute } from 'vitepress';
import DefaultTheme from 'vitepress/theme'; import DefaultTheme from 'vitepress/theme';
const { Layout } = DefaultTheme; const { Layout } = DefaultTheme;
const route = useRoute(); const route = useRoute();
// const { tokens } = useAntdDesignTokens();
const initZoom = () => { const initZoom = () => {
// mediumZoom('[data-zoomable]', { background: 'var(--vp-c-bg)' }); // mediumZoom('[data-zoomable]', { background: 'var(--vp-c-bg)' });
mediumZoom('.VPContent img', { background: 'var(--vp-c-bg)' }); mediumZoom('.VPContent img', { background: 'var(--vp-c-bg)' });
}; };
const isDark = ref(true);
watch( watch(
() => route.path, () => route.path,
() => nextTick(() => initZoom()), () => nextTick(() => initZoom()),
); );
// initPreferences({
// namespace: 'docs',
// });
onMounted(() => { onMounted(() => {
initZoom(); initZoom();
}); });
// 使用该函数
const observer = watchDarkModeChange((dark) => {
isDark.value = dark;
});
onBeforeUnmount(() => {
observer?.disconnect();
});
function watchDarkModeChange(callback: (isDark: boolean) => void) {
if (typeof window === 'undefined') {
return;
}
const htmlElement = document.documentElement;
const observer = new MutationObserver(() => {
const isDark = htmlElement.classList.contains('dark');
callback(isDark);
});
observer.observe(htmlElement, {
attributeFilter: ['class'],
attributes: true,
});
const initialIsDark = htmlElement.classList.contains('dark');
callback(initialIsDark);
return observer;
}
const tokenTheme = computed(() => {
const algorithm = isDark.value
? [theme.darkAlgorithm]
: [theme.defaultAlgorithm];
return {
algorithm,
// token: tokens,
};
});
</script> </script>
<template> <template>
<ConfigProvider :theme="tokenTheme">
<Layout /> <Layout />
</ConfigProvider>
</template> </template>
<style> <style>
......
...@@ -5,3 +5,7 @@ html.dark { ...@@ -5,3 +5,7 @@ html.dark {
.dark .VPContent { .dark .VPContent {
/* background-color: #14161a; */ /* background-color: #14161a; */
} }
.form-valid-error p {
margin: 0;
}
...@@ -7,10 +7,17 @@ ...@@ -7,10 +7,17 @@
"dev": "vitepress dev", "dev": "vitepress dev",
"docs:preview": "vitepress preview" "docs:preview": "vitepress preview"
}, },
"imports": {
"#/*": "./src/_env/*"
},
"dependencies": { "dependencies": {
"@vben-core/shadcn-ui": "workspace:*", "@vben-core/shadcn-ui": "workspace:*",
"@vben/common-ui": "workspace:*", "@vben/common-ui": "workspace:*",
"@vben/hooks": "workspace:*",
"@vben/locales": "workspace:*",
"@vben/preferences": "workspace:*",
"@vben/styles": "workspace:*", "@vben/styles": "workspace:*",
"ant-design-vue": "catalog:",
"lucide-vue-next": "catalog:", "lucide-vue-next": "catalog:",
"medium-zoom": "catalog:", "medium-zoom": "catalog:",
"radix-vue": "catalog:", "radix-vue": "catalog:",
......
import type {
BaseFormComponentType,
VbenFormSchema as FormSchema,
VbenFormProps,
} from '@vben/common-ui';
import { h } from 'vue';
import { setupVbenForm, useVbenForm as useForm, z } from '@vben/common-ui';
import { $t } from '@vben/locales';
import {
AutoComplete,
Button,
Checkbox,
CheckboxGroup,
DatePicker,
Divider,
Input,
InputNumber,
InputPassword,
Mentions,
Radio,
RadioGroup,
RangePicker,
Rate,
Select,
Space,
Switch,
Textarea,
TimePicker,
TreeSelect,
Upload,
} from 'ant-design-vue';
// 这里需要自行根据业务组件库进行适配,需要用到的组件都需要在这里类型说明
export type FormComponentType =
| 'AutoComplete'
| 'Checkbox'
| 'CheckboxGroup'
| 'DatePicker'
| 'Divider'
| 'Input'
| 'InputNumber'
| 'InputPassword'
| 'Mentions'
| 'Radio'
| 'RadioGroup'
| 'RangePicker'
| 'Rate'
| 'Select'
| 'Space'
| 'Switch'
| 'Textarea'
| 'TimePicker'
| 'TreeSelect'
| 'Upload'
| BaseFormComponentType;
// 初始化表单组件,并注册到form组件内部
setupVbenForm<FormComponentType>({
components: {
AutoComplete,
Checkbox,
CheckboxGroup,
DatePicker,
// 自定义默认的重置按钮
DefaultResetActionButton: (props, { attrs, slots }) => {
return h(Button, { ...props, attrs, type: 'default' }, slots);
},
// 自定义默认的提交按钮
DefaultSubmitActionButton: (props, { attrs, slots }) => {
return h(Button, { ...props, attrs, type: 'primary' }, slots);
},
Divider,
Input,
InputNumber,
InputPassword,
Mentions,
Radio,
RadioGroup,
RangePicker,
Rate,
Select,
Space,
Switch,
Textarea,
TimePicker,
TreeSelect,
Upload,
},
config: {
// ant design vue组件库默认都是 v-model:value
baseModelPropName: 'value',
// 一些组件是 v-model:checked 或者 v-model:fileList
modelPropNameMap: {
Checkbox: 'checked',
Radio: 'checked',
Switch: 'checked',
Upload: 'fileList',
},
},
defineRules: {
// 输入项目必填国际化适配
required: (value, _params, ctx) => {
if (value === undefined || value === null || value.length === 0) {
return $t('formRules.required', [ctx.label]);
}
return true;
},
// 选择项目必填国际化适配
selectRequired: (value, _params, ctx) => {
if (value === undefined || value === null) {
return $t('formRules.selectRequired', [ctx.label]);
}
return true;
},
},
});
const useVbenForm = useForm<FormComponentType>;
export { useVbenForm, z };
export type VbenFormSchema = FormSchema<FormComponentType>;
export type { VbenFormProps };
export * from './form';
---
outline: deep
---
# Vben CountToAnimator 数字动画
框架提供的数字动画组件,支持数字动画效果。
> 如果文档内没有参数说明,可以尝试在在线示例内寻找
::: info 写在前面
如果你觉得现有组件的封装不够理想,或者不完全符合你的需求,大可以直接使用原生组件,亦或亲手封装一个适合的组件。框架提供的组件并非束缚,使用与否,完全取决于你的需求与自由。
:::
## 基础用法
通过 `start-val` 和 `end-val`设置数字动画的开始值和结束值, 持续时间`3000`ms。
<DemoPreview dir="demos/vben-count-to-animator/basic" />
## 自定义前缀及分隔符
通过 `prefix` 和 `separator` 设置数字动画的前缀和分隔符。
<DemoPreview dir="demos/vben-count-to-animator/custom" />
### Props
| 属性名 | 描述 | 类型 | 默认值 |
| ---------- | -------------- | --------- | -------- |
| startVal | 起始值 | `number` | `0` |
| endVal | 结束值 | `number` | `2021` |
| duration | 动画持续时间 | `number` | `1500` |
| autoplay | 自动执行 | `boolean` | `true` |
| prefix | 前缀 | `string` | - |
| suffix | 后缀 | `string` | - |
| separator | 分隔符 | `string` | `,` |
| color | 字体颜色 | `string` | - |
| useEasing | 是否开启动画 | `boolean` | `true` |
| transition | 动画效果 | `string` | `linear` |
| decimals | 保留小数点位数 | `number` | `0` |
### Methods
以下事件,只有在 `useVbenModal({onCancel:()=>{}})` 中传入才会生效。
| 事件名 | 描述 | 类型 |
| ------ | ------------ | ---------- |
| start | 开始执行动画 | `()=>void` |
| reset | 重置 | `()=>void` |
<script lang="ts" setup>
import { VbenCountToAnimator } from '@vben/common-ui';
</script>
<template>
<VbenCountToAnimator :duration="3000" :end-val="30000" :start-val="1" />
</template>
<script lang="ts" setup>
import { VbenCountToAnimator } from '@vben/common-ui';
</script>
<template>
<VbenCountToAnimator
:duration="3000"
:end-val="2000000"
:start-val="1"
prefix="$"
separator="/"
/>
</template>
<script lang="ts" setup>
import { Button, message, Space } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
const [BaseForm, formApi] = useVbenForm({
// 所有表单项共用,可单独在表单内覆盖
commonConfig: {
// 所有表单项
componentProps: {
class: 'w-full',
},
},
// 使用 tailwindcss grid布局
// 提交函数
handleSubmit: onSubmit,
// 垂直布局,label和input在不同行,值为vertical
layout: 'horizontal',
// 水平布局,label和input在同一行
schema: [
{
// 组件需要在 #/adapter.ts内注册,并加上类型
component: 'Input',
// 对应组件的参数
componentProps: {
placeholder: '请输入用户名',
},
// 字段名
fieldName: 'field1',
// 界面显示的label
label: 'field1',
},
{
component: 'Select',
componentProps: {
allowClear: true,
filterOption: true,
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
],
placeholder: '请选择',
showSearch: true,
},
fieldName: 'fieldOptions',
label: '下拉选',
},
],
wrapperClass: 'grid-cols-1 md:grid-cols-2',
});
function onSubmit(values: Record<string, any>) {
message.success({
content: `form values: ${JSON.stringify(values)}`,
});
}
function handleClick(
action:
| 'batchAddSchema'
| 'batchDeleteSchema'
| 'disabled'
| 'hiddenAction'
| 'hiddenResetButton'
| 'hiddenSubmitButton'
| 'labelWidth'
| 'resetDisabled'
| 'resetLabelWidth'
| 'showAction'
| 'showResetButton'
| 'showSubmitButton'
| 'updateActionAlign'
| 'updateResetButton'
| 'updateSchema'
| 'updateSubmitButton',
) {
switch (action) {
case 'updateSchema': {
formApi.updateSchema([
{
componentProps: {
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
{
label: '选项3',
value: '3',
},
],
},
fieldName: 'fieldOptions',
},
]);
message.success('字段 `fieldOptions` 下拉选项更新成功。');
break;
}
case 'labelWidth': {
formApi.setState({
commonConfig: {
labelWidth: 150,
},
});
break;
}
case 'resetLabelWidth': {
formApi.setState({
commonConfig: {
labelWidth: 100,
},
});
break;
}
case 'disabled': {
formApi.setState({ commonConfig: { disabled: true } });
break;
}
case 'resetDisabled': {
formApi.setState({ commonConfig: { disabled: false } });
break;
}
case 'hiddenAction': {
formApi.setState({ showDefaultActions: false });
break;
}
case 'showAction': {
formApi.setState({ showDefaultActions: true });
break;
}
case 'hiddenResetButton': {
formApi.setState({ resetButtonOptions: { show: false } });
break;
}
case 'showResetButton': {
formApi.setState({ resetButtonOptions: { show: true } });
break;
}
case 'hiddenSubmitButton': {
formApi.setState({ submitButtonOptions: { show: false } });
break;
}
case 'showSubmitButton': {
formApi.setState({ submitButtonOptions: { show: true } });
break;
}
case 'updateResetButton': {
formApi.setState({
resetButtonOptions: { disabled: true },
});
break;
}
case 'updateSubmitButton': {
formApi.setState({
submitButtonOptions: { loading: true },
});
break;
}
case 'updateActionAlign': {
formApi.setState({
// 可以自行调整class
actionWrapperClass: 'text-center',
});
break;
}
case 'batchAddSchema': {
formApi.setState((prev) => {
const currentSchema = prev?.schema ?? [];
const newSchema = [];
for (let i = 0; i < 2; i++) {
newSchema.push({
component: 'Input',
componentProps: {
placeholder: '请输入',
},
fieldName: `field${i}${Date.now()}`,
label: `field+`,
});
}
return {
schema: [...currentSchema, ...newSchema],
};
});
break;
}
case 'batchDeleteSchema': {
formApi.setState((prev) => {
const currentSchema = prev?.schema ?? [];
return {
schema: currentSchema.slice(0, -2),
};
});
break;
}
}
}
</script>
<template>
<div>
<Space class="mb-5 flex-wrap">
<Button @click="handleClick('updateSchema')">updateSchema</Button>
<Button @click="handleClick('labelWidth')">更改labelWidth</Button>
<Button @click="handleClick('resetLabelWidth')">还原labelWidth</Button>
<Button @click="handleClick('disabled')">禁用表单</Button>
<Button @click="handleClick('resetDisabled')">解除禁用</Button>
<Button @click="handleClick('hiddenAction')">隐藏操作按钮</Button>
<Button @click="handleClick('showAction')">显示操作按钮</Button>
<Button @click="handleClick('hiddenResetButton')">隐藏重置按钮</Button>
<Button @click="handleClick('showResetButton')">显示重置按钮</Button>
<Button @click="handleClick('hiddenSubmitButton')">隐藏提交按钮</Button>
<Button @click="handleClick('showSubmitButton')">显示提交按钮</Button>
<Button @click="handleClick('updateResetButton')">修改重置按钮</Button>
<Button @click="handleClick('updateSubmitButton')">修改提交按钮</Button>
<Button @click="handleClick('updateActionAlign')">
调整操作按钮位置
</Button>
<Button @click="handleClick('batchAddSchema')"> 批量添加表单项 </Button>
<Button @click="handleClick('batchDeleteSchema')">
批量删除表单项
</Button>
</Space>
<BaseForm />
</div>
</template>
<script lang="ts" setup>
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
const [BaseForm] = useVbenForm({
// 所有表单项共用,可单独在表单内覆盖
commonConfig: {
// 所有表单项
componentProps: {
class: 'w-full',
},
},
// 提交函数
handleSubmit: onSubmit,
// 垂直布局,label和input在不同行,值为vertical
// 水平布局,label和input在同一行
layout: 'horizontal',
schema: [
{
// 组件需要在 #/adapter.ts内注册,并加上类型
component: 'Input',
// 对应组件的参数
componentProps: {
placeholder: '请输入用户名',
},
// 字段名
fieldName: 'username',
// 界面显示的label
label: '字符串',
},
{
component: 'InputPassword',
componentProps: {
placeholder: '请输入密码',
},
fieldName: 'password',
label: '密码',
},
{
component: 'InputNumber',
componentProps: {
placeholder: '请输入',
},
fieldName: 'number',
label: '数字(带后缀)',
suffix: () => '¥',
},
{
component: 'Select',
componentProps: {
allowClear: true,
filterOption: true,
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
],
placeholder: '请选择',
showSearch: true,
},
fieldName: 'options',
label: '下拉选',
},
{
component: 'RadioGroup',
componentProps: {
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
],
},
fieldName: 'radioGroup',
label: '单选组',
},
{
component: 'Radio',
fieldName: 'radio',
label: '',
renderComponentContent: () => {
return {
default: () => ['Radio'],
};
},
},
{
component: 'CheckboxGroup',
componentProps: {
name: 'cname',
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
],
},
fieldName: 'checkboxGroup',
label: '多选组',
},
{
component: 'Checkbox',
fieldName: 'checkbox',
label: '',
renderComponentContent: () => {
return {
default: () => ['我已阅读并同意'],
};
},
},
{
component: 'Mentions',
componentProps: {
options: [
{
label: 'afc163',
value: 'afc163',
},
{
label: 'zombieJ',
value: 'zombieJ',
},
],
placeholder: '请输入',
},
fieldName: 'mentions',
label: '提及',
},
{
component: 'Rate',
fieldName: 'rate',
label: '评分',
},
{
component: 'Switch',
componentProps: {
class: 'w-auto',
},
fieldName: 'switch',
label: '开关',
},
{
component: 'DatePicker',
fieldName: 'datePicker',
label: '日期选择框',
},
{
component: 'RangePicker',
fieldName: 'rangePicker',
label: '范围选择器',
},
{
component: 'TimePicker',
fieldName: 'timePicker',
label: '时间选择框',
},
{
component: 'TreeSelect',
componentProps: {
allowClear: true,
placeholder: '请选择',
showSearch: true,
treeData: [
{
label: 'root 1',
value: 'root 1',
children: [
{
label: 'parent 1',
value: 'parent 1',
children: [
{
label: 'parent 1-0',
value: 'parent 1-0',
children: [
{
label: 'my leaf',
value: 'leaf1',
},
{
label: 'your leaf',
value: 'leaf2',
},
],
},
{
label: 'parent 1-1',
value: 'parent 1-1',
},
],
},
{
label: 'parent 2',
value: 'parent 2',
},
],
},
],
treeNodeFilterProp: 'label',
},
fieldName: 'treeSelect',
label: '树选择',
},
],
wrapperClass: 'grid-cols-1',
});
function onSubmit(values: Record<string, any>) {
message.success({
content: `form values: ${JSON.stringify(values)}`,
});
}
</script>
<template>
<BaseForm />
</template>
<script lang="ts" setup>
import { h } from 'vue';
import { Input, message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
const [Form] = useVbenForm({
// 所有表单项共用,可单独在表单内覆盖
commonConfig: {
// 所有表单项
componentProps: {
class: 'w-full',
},
labelClass: 'w-2/6',
},
// 提交函数
handleSubmit: onSubmit,
// 垂直布局,label和input在不同行,值为vertical
// 水平布局,label和input在同一行
layout: 'horizontal',
schema: [
{
// 组件需要在 #/adapter.ts内注册,并加上类型
component: 'Input',
fieldName: 'field',
label: '自定义后缀',
suffix: () => h('span', { class: 'text-red-600' }, '元'),
},
{
component: 'Input',
fieldName: 'field1',
label: '自定义组件slot',
renderComponentContent: () => ({
prefix: () => 'prefix',
suffix: () => 'suffix',
}),
},
{
component: h(Input, { placeholder: '请输入' }),
fieldName: 'field2',
label: '自定义组件',
rules: 'required',
},
{
component: 'Input',
fieldName: 'field3',
label: '自定义组件(slot)',
rules: 'required',
},
],
wrapperClass: 'grid-cols-1',
});
function onSubmit(values: Record<string, any>) {
message.success({
content: `form values: ${JSON.stringify(values)}`,
});
}
</script>
<template>
<Form>
<template #field3="slotProps">
<Input placeholder="请输入" v-bind="slotProps" />
</template>
</Form>
</template>
<script lang="ts" setup>
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
const [Form] = useVbenForm({
// 提交函数
handleSubmit: onSubmit,
schema: [
{
component: 'Input',
defaultValue: 'hidden value',
dependencies: {
show: false,
// 随意一个字段改变时,都会触发
triggerFields: ['field1Switch'],
},
fieldName: 'hiddenField',
label: '隐藏字段',
},
{
component: 'Switch',
defaultValue: true,
fieldName: 'field1Switch',
help: '通过Dom控制销毁',
label: '显示字段1',
},
{
component: 'Switch',
defaultValue: true,
fieldName: 'field2Switch',
help: '通过css控制隐藏',
label: '显示字段2',
},
{
component: 'Switch',
fieldName: 'field3Switch',
label: '禁用字段3',
},
{
component: 'Switch',
fieldName: 'field4Switch',
label: '字段4必填',
},
{
component: 'Input',
dependencies: {
if(values) {
return !!values.field1Switch;
},
// 只有指定的字段改变时,才会触发
triggerFields: ['field1Switch'],
},
// 字段名
fieldName: 'field1',
// 界面显示的label
label: '字段1',
},
{
component: 'Input',
dependencies: {
show(values) {
return !!values.field2Switch;
},
triggerFields: ['field2Switch'],
},
fieldName: 'field2',
label: '字段2',
},
{
component: 'Input',
dependencies: {
disabled(values) {
return !!values.field3Switch;
},
triggerFields: ['field3Switch'],
},
fieldName: 'field3',
label: '字段3',
},
{
component: 'Input',
dependencies: {
required(values) {
return !!values.field4Switch;
},
triggerFields: ['field4Switch'],
},
fieldName: 'field4',
label: '字段4',
},
{
component: 'Input',
dependencies: {
rules(values) {
if (values.field1 === '123') {
return 'required';
}
return null;
},
triggerFields: ['field1'],
},
fieldName: 'field5',
help: '当字段1的值为`123`时,必填',
label: '动态rules',
},
{
component: 'Select',
componentProps: {
allowClear: true,
class: 'w-full',
filterOption: true,
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
],
placeholder: '请选择',
showSearch: true,
},
dependencies: {
componentProps(values) {
if (values.field2 === '123') {
return {
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
{
label: '选项3',
value: '3',
},
],
};
}
return {};
},
triggerFields: ['field2'],
},
fieldName: 'field6',
help: '当字段2的值为`123`时,更改下拉选项',
label: '动态配置',
},
],
// 大屏一行显示3个,中屏一行显示2个,小屏一行显示1个
wrapperClass: 'grid-cols-1 md:grid-cols-2',
});
function onSubmit(values: Record<string, any>) {
message.success({
content: `form values: ${JSON.stringify(values)}`,
});
}
</script>
<template>
<Form />
</template>
<script lang="ts" setup>
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
const [QueryForm] = useVbenForm({
// 默认展开
collapsed: false,
// 所有表单项共用,可单独在表单内覆盖
commonConfig: {
// 所有表单项
componentProps: {
class: 'w-full',
},
},
// 提交函数
handleSubmit: onSubmit,
// 垂直布局,label和input在不同行,值为vertical
// 水平布局,label和input在同一行
layout: 'horizontal',
schema: [
{
// 组件需要在 #/adapter.ts内注册,并加上类型
component: 'Input',
// 对应组件的参数
componentProps: {
placeholder: '请输入用户名',
},
// 字段名
fieldName: 'username',
// 界面显示的label
label: '字符串',
},
{
component: 'InputPassword',
componentProps: {
placeholder: '请输入密码',
},
fieldName: 'password',
label: '密码',
},
{
component: 'InputNumber',
componentProps: {
placeholder: '请输入',
},
fieldName: 'number',
label: '数字(带后缀)',
suffix: () => '¥',
},
{
component: 'Select',
componentProps: {
allowClear: true,
filterOption: true,
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
],
placeholder: '请选择',
showSearch: true,
},
fieldName: 'options',
label: '下拉选',
},
{
component: 'DatePicker',
fieldName: 'datePicker',
label: '日期选择框',
},
],
// 是否可展开
showCollapseButton: true,
submitButtonOptions: {
text: '查询',
},
wrapperClass: 'grid-cols-1 md:grid-cols-2',
});
function onSubmit(values: Record<string, any>) {
message.success({
content: `form values: ${JSON.stringify(values)}`,
});
}
</script>
<template>
<QueryForm />
</template>
<script lang="ts" setup>
import { message } from 'ant-design-vue';
import { useVbenForm, z } from '#/adapter';
const [Form] = useVbenForm({
// 所有表单项共用,可单独在表单内覆盖
commonConfig: {
// 所有表单项
componentProps: {
class: 'w-full',
},
},
// 提交函数
handleSubmit: onSubmit,
// 垂直布局,label和input在不同行,值为vertical
// 水平布局,label和input在同一行
layout: 'horizontal',
schema: [
{
// 组件需要在 #/adapter.ts内注册,并加上类型
component: 'Input',
// 对应组件的参数
componentProps: {
placeholder: '请输入',
},
// 字段名
fieldName: 'field1',
// 界面显示的label
label: '字段1',
rules: 'required',
},
{
component: 'Input',
componentProps: {
placeholder: '请输入',
},
defaultValue: '默认值',
fieldName: 'field2',
label: '默认值(必填)',
rules: 'required',
},
{
component: 'Input',
componentProps: {
placeholder: '请输入',
},
fieldName: 'field3',
label: '默认值(非必填)',
rules: z.string().default('默认值').optional(),
},
{
component: 'Input',
componentProps: {
placeholder: '请输入',
},
fieldName: 'field31',
label: '自定义信息',
rules: z.string().min(1, { message: '最少输入1个字符' }),
},
{
component: 'Input',
// 对应组件的参数
componentProps: {
placeholder: '请输入',
},
// 字段名
fieldName: 'field4',
// 界面显示的label
label: '邮箱',
rules: z.string().email('请输入正确的邮箱'),
},
{
component: 'InputNumber',
componentProps: {
placeholder: '请输入',
},
fieldName: 'number',
label: '数字',
rules: 'required',
},
{
component: 'Select',
componentProps: {
allowClear: true,
filterOption: true,
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
],
placeholder: '请选择',
showSearch: true,
},
defaultValue: undefined,
fieldName: 'options',
label: '下拉选',
rules: 'selectRequired',
},
{
component: 'RadioGroup',
componentProps: {
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
],
},
fieldName: 'radioGroup',
label: '单选组',
rules: 'selectRequired',
},
{
component: 'CheckboxGroup',
componentProps: {
name: 'cname',
options: [
{
label: '选项1',
value: '1',
},
{
label: '选项2',
value: '2',
},
],
},
fieldName: 'checkboxGroup',
label: '多选组',
rules: 'selectRequired',
},
{
component: 'Checkbox',
fieldName: 'checkbox',
label: '',
renderComponentContent: () => {
return {
default: () => ['我已阅读并同意'],
};
},
rules: 'selectRequired',
},
{
component: 'DatePicker',
defaultValue: undefined,
fieldName: 'datePicker',
label: '日期选择框',
rules: 'selectRequired',
},
{
component: 'RangePicker',
defaultValue: undefined,
fieldName: 'rangePicker',
label: '区间选择框',
rules: 'selectRequired',
},
{
component: 'InputPassword',
componentProps: {
placeholder: '请输入',
},
fieldName: 'password',
label: '密码',
rules: 'required',
},
],
wrapperClass: 'grid-cols-1',
});
function onSubmit(values: Record<string, any>) {
message.success({
content: `form values: ${JSON.stringify(values)}`,
});
}
</script>
<template>
<Form />
</template>
{ {
"$schema": "https://json.schemastore.org/tsconfig", "$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/tsconfig/web.json", "extends": "@vben/tsconfig/web.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"#/*": ["./src/_env/*"]
}
},
"include": [ "include": [
".vitepress/*.mts", ".vitepress/*.mts",
".vitepress/**/*.ts", ".vitepress/**/*.ts",
......
...@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest'; ...@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';
import { import {
getFirstNonNullOrUndefined, getFirstNonNullOrUndefined,
isBoolean,
isEmpty, isEmpty,
isHttpUrl, isHttpUrl,
isObject, isObject,
...@@ -96,6 +97,21 @@ describe('isWindow', () => { ...@@ -96,6 +97,21 @@ describe('isWindow', () => {
}); });
}); });
describe('isBoolean', () => {
it('should return true for boolean values', () => {
expect(isBoolean(true)).toBe(true);
expect(isBoolean(false)).toBe(true);
});
it('should return false for non-boolean values', () => {
expect(isBoolean(null)).toBe(false);
expect(isBoolean(42)).toBe(false);
expect(isBoolean('string')).toBe(false);
expect(isBoolean({})).toBe(false);
expect(isBoolean([])).toBe(false);
});
});
describe('isObject', () => { describe('isObject', () => {
it('should return true for objects', () => { it('should return true for objects', () => {
expect(isObject({})).toBe(true); expect(isObject({})).toBe(true);
......
...@@ -11,6 +11,15 @@ function isUndefined(value?: unknown): value is undefined { ...@@ -11,6 +11,15 @@ function isUndefined(value?: unknown): value is undefined {
} }
/** /**
* 检查传入的值是否为boolean
* @param value
* @returns 如果值是布尔值,返回true,否则返回false。
*/
function isBoolean(value: unknown): value is boolean {
return typeof value === 'boolean';
}
/**
* 检查传入的值是否为空。 * 检查传入的值是否为空。
* *
* 以下情况将被认为是空: * 以下情况将被认为是空:
...@@ -141,6 +150,7 @@ function getFirstNonNullOrUndefined<T>( ...@@ -141,6 +150,7 @@ function getFirstNonNullOrUndefined<T>(
export { export {
getFirstNonNullOrUndefined, getFirstNonNullOrUndefined,
isBoolean,
isEmpty, isEmpty,
isFunction, isFunction,
isHttpUrl, isHttpUrl,
......
...@@ -219,6 +219,12 @@ export class FormApi { ...@@ -219,6 +219,12 @@ export class FormApi {
async validate(opts?: Partial<ValidationOptions>) { async validate(opts?: Partial<ValidationOptions>) {
const form = await this.getForm(); const form = await this.getForm();
return await form.validate(opts);
const validateResult = await form.validate(opts);
if (Object.keys(validateResult?.errors ?? {}).length > 0) {
console.error('validate error', validateResult?.errors);
}
return validateResult;
} }
} }
...@@ -6,7 +6,7 @@ import type { ...@@ -6,7 +6,7 @@ import type {
import { computed, ref, watch } from 'vue'; import { computed, ref, watch } from 'vue';
import { isFunction } from '@vben-core/shared/utils'; import { isBoolean, isFunction } from '@vben-core/shared/utils';
import { useFormValues } from 'vee-validate'; import { useFormValues } from 'vee-validate';
...@@ -74,12 +74,18 @@ export default function useDependencies( ...@@ -74,12 +74,18 @@ export default function useDependencies(
isIf.value = !!(await whenIf(formValues, formApi)); isIf.value = !!(await whenIf(formValues, formApi));
// 不渲染 // 不渲染
if (!isIf.value) return; if (!isIf.value) return;
} else if (isBoolean(whenIf)) {
isIf.value = whenIf;
if (!isIf.value) return;
} }
// 2. 判断show,如果show为false,则隐藏 // 2. 判断show,如果show为false,则隐藏
if (isFunction(show)) { if (isFunction(show)) {
isShow.value = !!(await show(formValues, formApi)); isShow.value = !!(await show(formValues, formApi));
if (!isShow.value) return; if (!isShow.value) return;
} else if (isBoolean(show)) {
isShow.value = show;
if (!isShow.value) return;
} }
if (isFunction(componentProps)) { if (isFunction(componentProps)) {
...@@ -92,6 +98,8 @@ export default function useDependencies( ...@@ -92,6 +98,8 @@ export default function useDependencies(
if (isFunction(disabled)) { if (isFunction(disabled)) {
isDisabled.value = !!(await disabled(formValues, formApi)); isDisabled.value = !!(await disabled(formValues, formApi));
} else if (isBoolean(disabled)) {
isDisabled.value = disabled;
} }
if (isFunction(required)) { if (isFunction(required)) {
......
...@@ -85,7 +85,15 @@ const currentRules = computed(() => { ...@@ -85,7 +85,15 @@ const currentRules = computed(() => {
return dynamicRules.value || rules; return dynamicRules.value || rules;
}); });
const visible = computed(() => {
return isIf.value && isShow.value;
});
const shouldRequired = computed(() => { const shouldRequired = computed(() => {
if (!visible.value) {
return false;
}
if (!currentRules.value) { if (!currentRules.value) {
return isRequired.value; return isRequired.value;
} }
...@@ -113,6 +121,10 @@ const shouldRequired = computed(() => { ...@@ -113,6 +121,10 @@ const shouldRequired = computed(() => {
}); });
const fieldRules = computed(() => { const fieldRules = computed(() => {
if (!visible.value) {
return null;
}
let rules = currentRules.value; let rules = currentRules.value;
if (!rules) { if (!rules) {
return isRequired.value ? 'required' : null; return isRequired.value ? 'required' : null;
......
...@@ -88,12 +88,12 @@ export interface FormItemDependencies { ...@@ -88,12 +88,12 @@ export interface FormItemDependencies {
* 是否禁用 * 是否禁用
* @returns 是否禁用 * @returns 是否禁用
*/ */
disabled?: FormItemDependenciesCondition; disabled?: boolean | FormItemDependenciesCondition;
/** /**
* 是否渲染(删除dom) * 是否渲染(删除dom)
* @returns 是否渲染 * @returns 是否渲染
*/ */
if?: FormItemDependenciesCondition; if?: boolean | FormItemDependenciesCondition;
/** /**
* 是否必填 * 是否必填
* @returns 是否必填 * @returns 是否必填
...@@ -107,7 +107,7 @@ export interface FormItemDependencies { ...@@ -107,7 +107,7 @@ export interface FormItemDependencies {
* 是否隐藏(Css) * 是否隐藏(Css)
* @returns 是否隐藏 * @returns 是否隐藏
*/ */
show?: FormItemDependenciesCondition; show?: boolean | FormItemDependenciesCondition;
/** /**
* 任意触发都会执行 * 任意触发都会执行
*/ */
...@@ -141,7 +141,7 @@ export interface FormCommonConfig { ...@@ -141,7 +141,7 @@ export interface FormCommonConfig {
disabled?: boolean; disabled?: boolean;
/** /**
* 所有表单项的控件样式 * 所有表单项的控件样式
* @default "" * @default {}
*/ */
formFieldProps?: Partial<typeof Field>; formFieldProps?: Partial<typeof Field>;
/** /**
...@@ -161,7 +161,7 @@ export interface FormCommonConfig { ...@@ -161,7 +161,7 @@ export interface FormCommonConfig {
hideRequiredMark?: boolean; hideRequiredMark?: boolean;
/** /**
* 所有表单项的label样式 * 所有表单项的label样式
* @default "w-[100px]" * @default ""
*/ */
labelClass?: string; labelClass?: string;
/** /**
...@@ -295,6 +295,7 @@ export interface VbenFormProps< ...@@ -295,6 +295,7 @@ export interface VbenFormProps<
/** /**
* 是否显示默认操作按钮 * 是否显示默认操作按钮
* @default true
*/ */
showDefaultActions?: boolean; showDefaultActions?: boolean;
......
...@@ -162,11 +162,11 @@ function handleConfirm() { ...@@ -162,11 +162,11 @@ function handleConfirm() {
v-if="hintImage" v-if="hintImage"
:alt="$t('ui.captcha.alt')" :alt="$t('ui.captcha.alt')"
:src="hintImage" :src="hintImage"
class="h-10 w-full rounded border border-solid border-slate-200" class="border-border h-10 w-full rounded border"
/> />
<div <div
v-else-if="hintText" v-else-if="hintText"
class="flex h-10 w-full items-center justify-center rounded border border-solid border-slate-200" class="border-border flex-center h-10 w-full rounded border"
> >
{{ `${$t('ui.captcha.clickInOrder')}` + `【${hintText}】` }} {{ `${$t('ui.captcha.clickInOrder')}` + `【${hintText}】` }}
</div> </div>
......
...@@ -5,4 +5,11 @@ export * from '@vben-core/form-ui'; ...@@ -5,4 +5,11 @@ export * from '@vben-core/form-ui';
export * from '@vben-core/popup-ui'; export * from '@vben-core/popup-ui';
// 给文档用 // 给文档用
export { VbenButton } from '@vben-core/shadcn-ui'; export {
VbenButton,
VbenCountToAnimator,
VbenInputPassword,
VbenLoading,
VbenPinInput,
VbenSpinner,
} from '@vben-core/shadcn-ui';
...@@ -81,6 +81,7 @@ function handleClick(item: NotificationItem) { ...@@ -81,6 +81,7 @@ function handleClick(item: NotificationItem) {
<div class="flex items-center justify-between p-4 py-3"> <div class="flex items-center justify-between p-4 py-3">
<div class="text-foreground">{{ $t('widgets.notifications') }}</div> <div class="text-foreground">{{ $t('widgets.notifications') }}</div>
<VbenIconButton <VbenIconButton
:disabled="notifications.length <= 0"
:tooltip="$t('widgets.markAllAsRead')" :tooltip="$t('widgets.markAllAsRead')"
@click="handleMakeAll" @click="handleMakeAll"
> >
...@@ -131,7 +132,12 @@ function handleClick(item: NotificationItem) { ...@@ -131,7 +132,12 @@ function handleClick(item: NotificationItem) {
<div <div
class="border-border flex items-center justify-between border-t px-4 py-3" class="border-border flex items-center justify-between border-t px-4 py-3"
> >
<VbenButton size="sm" variant="ghost" @click="handleClear"> <VbenButton
:disabled="notifications.length <= 0"
size="sm"
variant="ghost"
@click="handleClear"
>
{{ $t('widgets.clearNotifications') }} {{ $t('widgets.clearNotifications') }}
</VbenButton> </VbenButton>
<VbenButton size="sm" @click="handleViewAll"> <VbenButton size="sm" @click="handleViewAll">
......
...@@ -27,13 +27,13 @@ import { ...@@ -27,13 +27,13 @@ import {
Select, Select,
Space, Space,
Switch, Switch,
Textarea,
TimePicker, TimePicker,
TreeSelect, TreeSelect,
Upload, Upload,
} from 'ant-design-vue'; } from 'ant-design-vue';
// 业务表单组件适配 // 这里需要自行根据业务组件库进行适配,需要用到的组件都需要在这里类型说明
export type FormComponentType = export type FormComponentType =
| 'AutoComplete' | 'AutoComplete'
| 'Checkbox' | 'Checkbox'
...@@ -51,6 +51,7 @@ export type FormComponentType = ...@@ -51,6 +51,7 @@ export type FormComponentType =
| 'Select' | 'Select'
| 'Space' | 'Space'
| 'Switch' | 'Switch'
| 'Textarea'
| 'TimePicker' | 'TimePicker'
| 'TreeSelect' | 'TreeSelect'
| 'Upload' | 'Upload'
...@@ -83,12 +84,16 @@ setupVbenForm<FormComponentType>({ ...@@ -83,12 +84,16 @@ setupVbenForm<FormComponentType>({
Select, Select,
Space, Space,
Switch, Switch,
Textarea,
TimePicker, TimePicker,
TreeSelect, TreeSelect,
Upload, Upload,
}, },
config: { config: {
// ant design vue组件库默认都是 v-model:value
baseModelPropName: 'value', baseModelPropName: 'value',
// 一些组件是 v-model:checked 或者 v-model:fileList
modelPropNameMap: { modelPropNameMap: {
Checkbox: 'checked', Checkbox: 'checked',
Radio: 'checked', Radio: 'checked',
...@@ -97,12 +102,14 @@ setupVbenForm<FormComponentType>({ ...@@ -97,12 +102,14 @@ setupVbenForm<FormComponentType>({
}, },
}, },
defineRules: { defineRules: {
// 输入项目必填国际化适配
required: (value, _params, ctx) => { required: (value, _params, ctx) => {
if ((!value && value !== 0) || value.length === 0) { if (value === undefined || value === null || value.length === 0) {
return $t('formRules.required', [ctx.label]); return $t('formRules.required', [ctx.label]);
} }
return true; return true;
}, },
// 选择项目必填国际化适配
selectRequired: (value, _params, ctx) => { selectRequired: (value, _params, ctx) => {
if (value === undefined || value === null) { if (value === undefined || value === null) {
return $t('formRules.selectRequired', [ctx.label]); return $t('formRules.selectRequired', [ctx.label]);
......
...@@ -114,6 +114,7 @@ function handleClick( ...@@ -114,6 +114,7 @@ function handleClick(
fieldName: 'fieldOptions', fieldName: 'fieldOptions',
}, },
]); ]);
message.success('字段 `fieldOptions` 下拉选项更新成功。');
break; break;
} }
......
...@@ -7,7 +7,7 @@ import { Card, Input, message } from 'ant-design-vue'; ...@@ -7,7 +7,7 @@ import { Card, Input, message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter'; import { useVbenForm } from '#/adapter';
const [BaseForm] = useVbenForm({ const [Form] = useVbenForm({
// 所有表单项共用,可单独在表单内覆盖 // 所有表单项共用,可单独在表单内覆盖
commonConfig: { commonConfig: {
// 所有表单项 // 所有表单项
...@@ -65,11 +65,11 @@ function onSubmit(values: Record<string, any>) { ...@@ -65,11 +65,11 @@ function onSubmit(values: Record<string, any>) {
<template> <template>
<Page description="表单组件自定义示例" title="表单组件"> <Page description="表单组件自定义示例" title="表单组件">
<Card title="基础示例"> <Card title="基础示例">
<BaseForm> <Form>
<template #field3="slotProps"> <template #field3="slotProps">
<Input placeholder="请输入" v-bind="slotProps" /> <Input placeholder="请输入" v-bind="slotProps" />
</template> </template>
</BaseForm> </Form>
</Card> </Card>
</Page> </Page>
</template> </template>
...@@ -10,6 +10,17 @@ const [Form, formApi] = useVbenForm({ ...@@ -10,6 +10,17 @@ const [Form, formApi] = useVbenForm({
handleSubmit: onSubmit, handleSubmit: onSubmit,
schema: [ schema: [
{ {
component: 'Input',
defaultValue: 'hidden value',
dependencies: {
show: false,
// 随意一个字段改变时,都会触发
triggerFields: ['field1Switch'],
},
fieldName: 'hiddenField',
label: '隐藏字段',
},
{
component: 'Switch', component: 'Switch',
defaultValue: true, defaultValue: true,
fieldName: 'field1Switch', fieldName: 'field1Switch',
......
...@@ -24,7 +24,7 @@ catalog: ...@@ -24,7 +24,7 @@ catalog:
'@iconify/json': ^2.2.251 '@iconify/json': ^2.2.251
'@iconify/tailwind': ^1.1.3 '@iconify/tailwind': ^1.1.3
'@iconify/vue': ^4.1.2 '@iconify/vue': ^4.1.2
'@intlify/core-base': ^10.0.1 '@intlify/core-base': ^10.0.2
'@intlify/unplugin-vue-i18n': ^5.0.0 '@intlify/unplugin-vue-i18n': ^5.0.0
'@jspm/generator': ^2.3.1 '@jspm/generator': ^2.3.1
'@manypkg/get-packages': ^2.2.2 '@manypkg/get-packages': ^2.2.2
...@@ -53,8 +53,8 @@ catalog: ...@@ -53,8 +53,8 @@ catalog:
'@vite-pwa/vitepress': ^0.5.3 '@vite-pwa/vitepress': ^0.5.3
'@vitejs/plugin-vue': ^5.1.4 '@vitejs/plugin-vue': ^5.1.4
'@vitejs/plugin-vue-jsx': ^4.0.1 '@vitejs/plugin-vue-jsx': ^4.0.1
'@vue/reactivity': ^3.5.7 '@vue/reactivity': ^3.5.8
'@vue/shared': ^3.5.7 '@vue/shared': ^3.5.8
'@vue/test-utils': ^2.4.6 '@vue/test-utils': ^2.4.6
'@vueuse/core': ^11.1.0 '@vueuse/core': ^11.1.0
'@vueuse/integrations': ^11.1.0 '@vueuse/integrations': ^11.1.0
...@@ -106,7 +106,7 @@ catalog: ...@@ -106,7 +106,7 @@ catalog:
html-minifier-terser: ^7.2.0 html-minifier-terser: ^7.2.0
husky: ^9.1.6 husky: ^9.1.6
is-ci: ^3.0.1 is-ci: ^3.0.1
jsdom: ^25.0.0 jsdom: ^25.0.1
jsonc-eslint-parser: ^2.4.0 jsonc-eslint-parser: ^2.4.0
jsonwebtoken: ^9.0.2 jsonwebtoken: ^9.0.2
lint-staged: ^15.2.10 lint-staged: ^15.2.10
...@@ -139,7 +139,7 @@ catalog: ...@@ -139,7 +139,7 @@ catalog:
sass: ^1.79.3 sass: ^1.79.3
sortablejs: ^1.15.3 sortablejs: ^1.15.3
stylelint: ^16.9.0 stylelint: ^16.9.0
stylelint-config-recess-order: ^5.1.0 stylelint-config-recess-order: ^5.1.1
stylelint-config-recommended: ^14.0.1 stylelint-config-recommended: ^14.0.1
stylelint-config-recommended-scss: ^14.1.0 stylelint-config-recommended-scss: ^14.1.0
stylelint-config-recommended-vue: ^1.5.0 stylelint-config-recommended-vue: ^1.5.0
...@@ -166,9 +166,9 @@ catalog: ...@@ -166,9 +166,9 @@ catalog:
vitepress: ^1.3.4 vitepress: ^1.3.4
vitepress-plugin-group-icons: ^1.2.4 vitepress-plugin-group-icons: ^1.2.4
vitest: ^2.1.1 vitest: ^2.1.1
vue: ^3.5.7 vue: ^3.5.8
vue-eslint-parser: ^9.4.3 vue-eslint-parser: ^9.4.3
vue-i18n: ^10.0.1 vue-i18n: ^10.0.2
vue-router: ^4.4.5 vue-router: ^4.4.5
vue-tsc: ^2.1.6 vue-tsc: ^2.1.6
watermark-js-plus: ^1.5.6 watermark-js-plus: ^1.5.6
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!