feat(baInput):远程下拉增加信息提示框 !90

This commit is contained in:
Moonights 2023-02-03 08:45:15 +00:00 committed by 妙码生花
parent 9657d95b5f
commit c0852ed583

View File

@ -22,7 +22,14 @@
:label="item[field]"
:value="item[state.primaryKey].toString()"
:key="item[state.primaryKey]"
></el-option>
>
<el-tooltip placement="right" effect="light" v-if="Object.keys(tooltipParams).length!==0">
<template #content>
<p v-for="(tooltipParam, key) in tooltipParams" :key="key">{{ key }}: {{ item[tooltipParam] }}</p>
</template>
<div>{{ item[field] }}</div>
</el-tooltip>
</el-option>
<el-pagination
v-if="state.total"
:currentPage="state.currentPage"
@ -52,6 +59,7 @@ interface Props {
remoteUrl: string
modelValue: valType
labelFormatter?: (optionData: anyObj, optionKey: string) => string
tooltipParams?: anyObj
}
const props = withDefaults(defineProps<Props>(), {
pk: 'id',
@ -62,6 +70,9 @@ const props = withDefaults(defineProps<Props>(), {
remoteUrl: '',
modelValue: '',
multiple: false,
tooltipParams: () => {
return {}
},
})
const state: {