From f198443eaa6d219e0219385821c17aa18637aab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sat, 4 Jun 2022 19:43:18 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(form-item):=20=E6=96=B0=E5=A2=9E=20la?= =?UTF-8?q?bel-position=20=E5=AF=B9=E9=BD=90=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/package.json | 2 +- .../component/src/component/form/index.less | 17 +++++ .../src/component/formItem/index.vue | 4 +- .../src/document/zh-CN/components/form.md | 72 +++++++++++++++++++ .../src/document/zh-CN/guide/changelog.md | 6 +- 5 files changed, 96 insertions(+), 5 deletions(-) diff --git a/package/component/package.json b/package/component/package.json index 23e73792..c2438187 100644 --- a/package/component/package.json +++ b/package/component/package.json @@ -1,6 +1,6 @@ { "name": "@layui/layui-vue", - "version": "1.1.5-alpha.4", + "version": "1.1.5-alpha.5", "author": "就眠儀式", "license": "MIT", "description": "a component library for Vue 3 base on layui-vue", diff --git a/package/component/src/component/form/index.less b/package/component/src/component/form/index.less index b3d5dc75..b4a8463c 100644 --- a/package/component/src/component/form/index.less +++ b/package/component/src/component/form/index.less @@ -4,6 +4,23 @@ *zoom: 1; } +.layui-form-item-right .layui-form-label { + text-align: right; +} + +.layui-form-item-left .layui-form-label { + text-align: left; +} + +.layui-form-item-top .layui-form-label { + text-align: left; + float: none; +} + +.layui-form-item-top > div { + margin-left: 0; +} + .layui-form-item:after { content: "\20"; clear: both; diff --git a/package/component/src/component/formItem/index.vue b/package/component/src/component/formItem/index.vue index 3e2d5ee2..97b4b509 100644 --- a/package/component/src/component/formItem/index.vue +++ b/package/component/src/component/formItem/index.vue @@ -32,6 +32,7 @@ export interface LayFormItemProps { prop?: string; mode?: string; label?: string; + labelPosition?: string; errorMessage?: string; rules?: Rule; required?: boolean; @@ -39,6 +40,7 @@ export interface LayFormItemProps { const props = withDefaults(defineProps(), { mode: "block", + labelPosition: 'right' }); const layForm = inject("LayForm", {} as LayFormContext); @@ -163,7 +165,7 @@ onMounted(() => { + + + +::: + ::: title 表单基本校验功能 ::: diff --git a/package/document/src/document/zh-CN/guide/changelog.md b/package/document/src/document/zh-CN/guide/changelog.md index a73ce16e..7265ca1a 100644 --- a/package/document/src/document/zh-CN/guide/changelog.md +++ b/package/document/src/document/zh-CN/guide/changelog.md @@ -16,11 +16,11 @@
  • 1.1.5 2022-06-04