提交 ef790af1 编写于 作者: jlj05024111@163.com's avatar jlj05024111@163.com

feat: 更新表单项支持输入提示

上级 4591b4f9
...@@ -22,6 +22,9 @@ export default defineComponent({ ...@@ -22,6 +22,9 @@ export default defineComponent({
type: Number, type: Number,
required: true, required: true,
}, },
inputTip: {
type: String,
},
}, },
setup(props) { setup(props) {
const ns = useNamespace('form-item-container'); const ns = useNamespace('form-item-container');
...@@ -48,14 +51,32 @@ export default defineComponent({ ...@@ -48,14 +51,32 @@ export default defineComponent({
<div class={[this.ns.b('content')]}> <div class={[this.ns.b('content')]}>
{this.labelPos === 'LEFT' || this.labelPos === 'TOP' ? ( {this.labelPos === 'LEFT' || this.labelPos === 'TOP' ? (
<div class={[this.ns.e('label')]} title={this.label}> <div class={[this.ns.e('label')]} title={this.label}>
{this.label} {this.inputTip && (
<i-tooltip
content={this.inputTip}
transfer-class-name={this.ns.b('input-tip-popper')}
class={[this.ns.b('input-tip')]}
>
<ion-icon name='help-circle-outline'></ion-icon>
</i-tooltip>
)}
<span class={[this.ns.em('label', 'text')]}>{this.label}</span>
</div> </div>
) : null} ) : null}
<div class={[this.ns.e('editor')]}>{this.$slots.default}</div> <div class={[this.ns.e('editor')]}>{this.$slots.default}</div>
{this.labelPos === 'RIGHT' || this.labelPos === 'BOTTOM' ? ( {this.labelPos === 'RIGHT' || this.labelPos === 'BOTTOM' ? (
<div class={[this.ns.e('label')]} title={this.label}> <div class={[this.ns.e('label')]} title={this.label}>
{this.label} {this.inputTip && (
<i-tooltip
content={this.inputTip}
class={[this.ns.b('input-tip')]}
transfer-class-name={this.ns.b('input-tip-popper')}
>
<ion-icon name='help-circle-outline'></ion-icon>
</i-tooltip>
)}
<span class={[this.ns.em('label', 'text')]}>{this.label}</span>
</div> </div>
) : null} ) : null}
</div> </div>
......
...@@ -57,6 +57,7 @@ export const FormItem = defineComponent({ ...@@ -57,6 +57,7 @@ export const FormItem = defineComponent({
class={[this.ns.b(), this.ns.m(this.modelData.modelClass)]} class={[this.ns.b(), this.ns.m(this.modelData.modelClass)]}
required={this.c.required} required={this.c.required}
error={this.c.error} error={this.c.error}
input-tip={this.controller.editor?.editorParams?.inputTip}
label={this.modelData.source.caption} label={this.modelData.source.caption}
label-pos={this.c.model.labelPos} label-pos={this.c.model.labelPos}
label-width={this.c.model.labelWidth} label-width={this.c.model.labelWidth}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册