mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-18 12:34:25 +08:00
feat(form-item): label=false to hide label area
This commit is contained in:
parent
8cc44dd656
commit
0c20f4b200
@ -25,6 +25,7 @@
|
||||
-->
|
||||
<n-form-item
|
||||
ignore-path-change
|
||||
:label="false"
|
||||
:path="`dynamicInputValue[${index}].name`"
|
||||
:rule="dynamicInputRule"
|
||||
>
|
||||
@ -40,6 +41,7 @@
|
||||
<div style="height: 34px; line-height: 34px; margin: 0 8px;">=</div>
|
||||
<n-form-item
|
||||
ignore-path-change
|
||||
:label="false"
|
||||
:path="`dynamicInputValue[${index}].value`"
|
||||
:rule="dynamicInputRule"
|
||||
>
|
||||
|
@ -22,6 +22,7 @@
|
||||
-->
|
||||
<n-form-item
|
||||
ignore-path-change
|
||||
:label="false"
|
||||
:path="`dynamicInputValue[${index}].name`"
|
||||
:rule="dynamicInputRule"
|
||||
>
|
||||
@ -37,6 +38,7 @@
|
||||
<div style="height: 34px; line-height: 34px; margin: 0 8px;">=</div>
|
||||
<n-form-item
|
||||
ignore-path-change
|
||||
:label="false"
|
||||
:path="`dynamicInputValue[${index}].value`"
|
||||
:rule="dynamicInputRule"
|
||||
>
|
||||
|
@ -45,7 +45,7 @@ import {
|
||||
|
||||
export const formItemProps = {
|
||||
...(useTheme.props as ThemeProps<FormTheme>),
|
||||
label: String,
|
||||
label: String as PropType<string | false>,
|
||||
labelWidth: [Number, String] as PropType<string | number>,
|
||||
labelStyle: [String, Object] as PropType<CSSProperties | string>,
|
||||
labelAlign: String as PropType<LabelAlign>,
|
||||
@ -369,7 +369,8 @@ export default defineComponent({
|
||||
'n-form-item',
|
||||
[
|
||||
`n-form-item--${this.mergedSize}-size`,
|
||||
`n-form-item--${this.mergedLabelPlacement}-labelled`
|
||||
`n-form-item--${this.mergedLabelPlacement}-labelled`,
|
||||
this.label === false && 'n-form-item--no-label'
|
||||
]
|
||||
]}
|
||||
style={this.cssVars as CSSProperties}
|
||||
|
@ -65,6 +65,12 @@ export default cB('form-item', {
|
||||
"feedback";
|
||||
grid-template-rows: var(--label-height) 1fr;
|
||||
`, [
|
||||
cM('no-label', `
|
||||
grid-template-areas:
|
||||
"blank"
|
||||
"feedback";
|
||||
grid-template-rows: 1fr;
|
||||
`),
|
||||
cB('form-item-label', {
|
||||
display: 'flex',
|
||||
alignItems: 'flex-end'
|
||||
|
5
src/shims-vue.d.ts
vendored
5
src/shims-vue.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
declare module '*.vue' {
|
||||
import { defineComponent } from 'vue'
|
||||
const component: ReturnType<typeof defineComponent>
|
||||
export default component
|
||||
}
|
Loading…
Reference in New Issue
Block a user