import { defineComponent } from 'vue'
|
import Icon from '@/components/Icon/Icon'
|
import styles from './Select.module.scss'
|
|
export default defineComponent<{ [key: string]: any }>({
|
name: 'Option',
|
|
setup(props, { attrs, slots, emit }) {
|
return () => {
|
if (attrs.tip) {
|
return (
|
<el-option {...attrs}>
|
<div class={styles.option}>
|
<span>{attrs.label}</span>
|
<el-tooltip effect="dark" content={attrs.tip} placement="top">
|
<Icon icon="wen" width={16} height={16} />
|
</el-tooltip>
|
</div>
|
</el-option>
|
)
|
}
|
return <el-option {...attrs}>{slots.default?.()}</el-option>
|
}
|
},
|
})
|