refactor(baInput):优化 FormItem 的 props.tip

This commit is contained in:
妙码生花 2024-06-26 18:26:43 +08:00
parent a85d7b727e
commit 7db6514a08

View File

@ -45,6 +45,7 @@ export default defineComponent({
type: String,
default: '',
},
tip: [String, Object],
...formItemProps,
},
emits: ['update:modelValue'],
@ -91,7 +92,7 @@ export default defineComponent({
if (attrs.tip) {
const createTipNode = () => {
const tipProps = typeof attrs.tip === 'string' ? { content: attrs.tip } : attrs.tip
const tipProps = typeof attrs.tip === 'string' ? { content: attrs.tip, placement: 'top' } : attrs.tip
return createVNode(resolveComponent('el-tooltip'), tipProps, {
default: () => [
createVNode('i', {