Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/renderless/src/form-item/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const initState = ({
validateIcon: computed(() => api.computedValidateIcon()),
isErrorInline: computed(() => api.computedIsErrorInline()),
isErrorBlock: computed(() => api.computedIsErrorBlock()),
disabled: computed(() => state.formInstance.disabled),
disabled: computed(() => state.formInstance.disabled || props.disabled),
tooltipType: computed(() => state.formInstance.state.tooltipType),
// 标记表单项下是否有多个子节点
isMultiple: false
Expand Down
4 changes: 4 additions & 0 deletions packages/theme-saas/src/form-item/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@
@apply whitespace-nowrap;
@apply text-ellipsis;
@apply text-right;

&.is-disabled {
@apply text-color-text-disabled;
}
}

&__content {
Expand Down
6 changes: 5 additions & 1 deletion packages/vue/src/form-item/src/mobile-first.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
state.labelPosition === 'top' && !state.hideRequiredAsterisk
? 'overflow-visible relative before:absolute before:-left-2.5'
: '',
state.disabled ? 'text-color-icon-placeholder sm:text-color-text-secondary' : 'text-color-text-secondary',
state.disabled ? 'text-color-icon-placeholder sm:text-color-text-disabled' : 'text-color-text-secondary',
state.formItemSize !== 'mini' ? 'sm:text-sm' : 'sm:text-xs'
)
"
Expand Down Expand Up @@ -189,6 +189,10 @@ export default defineComponent({
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
},
size: String,
tipContent: String,
validateDisabled: Boolean,
Expand Down
11 changes: 8 additions & 3 deletions packages/vue/src/form-item/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export default defineComponent({
type: Boolean,
default: undefined
},
disabled: {
type: Boolean,
default: false
},
error: String,
for: String,
inlineMessage: {
Expand Down Expand Up @@ -131,8 +135,8 @@ export default defineComponent({
typeof this.appendToBody === 'boolean'
? this.appendToBody
: typeof formAppendToBody === 'boolean'
? formAppendToBody
: true
? formAppendToBody
: true
const validatePosition = this.validatePosition || state.formInstance?.validatePosition || 'top-end'

const popperOptions = {
Expand Down Expand Up @@ -285,7 +289,8 @@ export default defineComponent({
{
class: {
[`${classPrefix}form-item__label`]: true,
'is-ellipsis': isMobile && ellipsis
'is-ellipsis': isMobile && ellipsis,
'is-disabled': state.disabled
},
style: state.labelStyle,
attrs: {
Expand Down
Loading