index.jsx 596 B

12345678910111213141516171819202122
  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. props: {
  7. noArrow: Boolean
  8. },
  9. setup (props, { attrs, slots }) {
  10. return () => <ElDropdown>
  11. {{
  12. default: () => <div class={'cip-dropdown__title'}>
  13. {slots.default?.()}
  14. {(!attrs.disabled && !props.noArrow) && <ElIcon class={'cip-dropdown__icon'}>
  15. <CaretBottom />
  16. </ElIcon>}
  17. </div>,
  18. dropdown: () => slots.dropdown?.()
  19. }}
  20. </ElDropdown>
  21. }
  22. }