theme.jsx 777 B

1234567891011121314151617181920
  1. import CipDropdown from '../../cip-dropdown'
  2. import { ElDropdownItem, ElDropdownMenu } from 'element-plus'
  3. export default {
  4. props: { modelValue: String },
  5. emits: ['update:modelValue'],
  6. setup (props, { emit }) {
  7. const layoutOptions = ['standard', 'dark', 'light', 'data-center', 'smart-center']
  8. const handlerCommand = (val) => {
  9. emit('update:modelValue', val)
  10. }
  11. return () => <CipDropdown style={'height: 100%'} onCommand={(val) => handlerCommand(val)}>
  12. {{
  13. default: () => <span title={'主题'}>{props.modelValue}</span>,
  14. dropdown: () => <ElDropdownMenu >
  15. {layoutOptions.map(option => <ElDropdownItem key={option} command={option}>{option}</ElDropdownItem>)}
  16. </ElDropdownMenu>
  17. }}
  18. </CipDropdown>
  19. }
  20. }