index.jsx 571 B

1234567891011121314151617181920
  1. import { ElDropdown, ElIcon } from 'element-plus'
  2. import { CaretBottom } from '@element-plus/icons-vue'
  3. import './index.less'
  4. export default {
  5. name: 'CipDropdown',
  6. setup (props, { attrs, slots }) {
  7. console.log(attrs.disabled)
  8. return () => <ElDropdown>
  9. {{
  10. default: () => <div class={'cip-dropdown__title'}>
  11. {slots.default?.()}
  12. {!attrs.disabled && <ElIcon class={'cip-dropdown__icon'}>
  13. <CaretBottom />
  14. </ElIcon>}
  15. </div>,
  16. dropdown: () => slots.dropdown?.()
  17. }}
  18. </ElDropdown>
  19. }
  20. }