From d31535cd986f5bec92744da7855018f7f495fb39 Mon Sep 17 00:00:00 2001 From: BobbyCheng <59609206+9ilfoyl3@users.noreply.github.com> Date: Mon, 4 Nov 2024 21:56:52 +0800 Subject: [PATCH 1/3] docs(@vben/docs): add public static resources path documentation (#4788) (#4801) Co-authored-by: chengjm <3497346788@qq.com> --- docs/src/en/guide/essentials/development.md | 6 ++++++ docs/src/guide/essentials/development.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/docs/src/en/guide/essentials/development.md b/docs/src/en/guide/essentials/development.md index 287c0a96..da7cfd8c 100644 --- a/docs/src/en/guide/essentials/development.md +++ b/docs/src/en/guide/essentials/development.md @@ -150,6 +150,12 @@ To run the `docs` application: pnpm dev:docs ``` +## Public Static Resources + +If you need to use public static resources in the project, such as images, static HTML, etc., and you want to directly import them in the development process through `src="/xxx.png"`. + +You need to put the resource in the corresponding project's `public/static` directory. The import path for the resource should be `src="/static/xxx.png"`. + ## DevTools The project has a built-in [Vue DevTools](https://github.com/vuejs/devtools-next) plugin, which can be used during development. It is disabled by default, but can be enabled in the `.env.development` file. After enabling it, restart the project: diff --git a/docs/src/guide/essentials/development.md b/docs/src/guide/essentials/development.md index 7e64564f..556e4c9d 100644 --- a/docs/src/guide/essentials/development.md +++ b/docs/src/guide/essentials/development.md @@ -150,6 +150,12 @@ pnpm dev:ele pnpm dev:docs ``` +## 公共静态资源 + +项目中需要使用到的公共静态资源,如:图片、静态HTML等,需要在开发中通过 `src="/xxx.png"` 直接引入的。 + +需要将资源放在对应项目的 `public/static` 目录下。引入的路径为:`src="/static/xxx.png"`。 + ## DevTools 项目内置了 [Vue DevTools](https://github.com/vuejs/devtools-next) 插件,可以在开发过程中使用。默认关闭,可在`.env.development` 内开启,并重新运行项目即可: From 5999a862b688fc28ce846be9c1b2f3db7e2316c2 Mon Sep 17 00:00:00 2001 From: Vben Date: Mon, 4 Nov 2024 22:46:16 +0800 Subject: [PATCH 2/3] perf: expose the formApi for a login form (#4806) --- packages/@core/base/shared/package.json | 2 + .../src/ui/authentication/code-login.vue | 10 +- .../src/ui/authentication/forget-password.vue | 10 +- .../common-ui/src/ui/authentication/login.vue | 12 +- .../src/ui/authentication/register.vue | 10 +- .../plugins/src/vxe-table/use-vxe-grid.vue | 23 +- pnpm-lock.yaml | 817 ++++++++++++------ pnpm-workspace.yaml | 26 +- 8 files changed, 589 insertions(+), 321 deletions(-) diff --git a/packages/@core/base/shared/package.json b/packages/@core/base/shared/package.json index 747610b0..bc50b9dc 100644 --- a/packages/@core/base/shared/package.json +++ b/packages/@core/base/shared/package.json @@ -81,10 +81,12 @@ "dependencies": { "@ctrl/tinycolor": "catalog:", "@tanstack/vue-store": "catalog:", + "@types/lodash.get": "catalog:", "@vue/shared": "catalog:", "clsx": "catalog:", "defu": "catalog:", "lodash.clonedeep": "catalog:", + "lodash.get": "catalog:", "nprogress": "catalog:", "tailwind-merge": "catalog:", "theme-colors": "catalog:" diff --git a/packages/effects/common-ui/src/ui/authentication/code-login.vue b/packages/effects/common-ui/src/ui/authentication/code-login.vue index cf950abd..7de5dd3b 100644 --- a/packages/effects/common-ui/src/ui/authentication/code-login.vue +++ b/packages/effects/common-ui/src/ui/authentication/code-login.vue @@ -53,7 +53,7 @@ const emit = defineEmits<{ const router = useRouter(); -const [Form, { validate, getValues }] = useVbenForm( +const [Form, formApi] = useVbenForm( reactive({ commonConfig: { hideLabel: true, @@ -65,8 +65,8 @@ const [Form, { validate, getValues }] = useVbenForm( ); async function handleSubmit() { - const { valid } = await validate(); - const values = await getValues(); + const { valid } = await formApi.validate(); + const values = await formApi.getValues(); if (valid) { emit('submit', { code: values?.code, @@ -78,6 +78,10 @@ async function handleSubmit() { function goToLogin() { router.push(props.loginPath); } + +defineExpose({ + getFormApi: () => formApi, +});