element-plus
Version:
A Component Library for Vue 3
1 lines • 2.25 kB
Source Map (JSON)
{"version":3,"file":"option-item.mjs","names":[],"sources":["../../../../../../packages/components/select-v2/src/option-item.vue"],"sourcesContent":["<template>\n <li\n :id=\"`${contentId}-${index}`\"\n role=\"option\"\n :aria-selected=\"selected\"\n :aria-disabled=\"disabled || undefined\"\n :style=\"style\"\n :class=\"[\n ns.be('dropdown', 'item'),\n ns.is('selected', selected),\n ns.is('disabled', disabled),\n ns.is('created', created),\n ns.is('hovering', hovering),\n ]\"\n @mousemove=\"hoverItem\"\n @click.stop=\"selectOptionClick\"\n >\n <slot :item=\"item\" :index=\"index\" :disabled=\"disabled\">\n <span>{{ getLabel(item) }}</span>\n </slot>\n </li>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, inject } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useOption } from './useOption'\nimport { useProps } from './useProps'\nimport { optionV2Emits, optionV2Props } from './defaults'\nimport { selectV2InjectionKey } from './token'\n\nexport default defineComponent({\n props: optionV2Props,\n emits: optionV2Emits,\n setup(props, { emit }) {\n const select = inject(selectV2InjectionKey)!\n const ns = useNamespace('select')\n const { hoverItem, selectOptionClick } = useOption(props, { emit })\n const { getLabel } = useProps(select.props)\n const contentId = select.contentId\n\n return {\n ns,\n contentId,\n hoverItem,\n selectOptionClick,\n getLabel,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;qBACE,mBAmBK,MAAA;EAlBF,IAAE,GAAK,KAAA,UAAS,GAAI,KAAA;EACrB,MAAK;EACJ,iBAAe,KAAA;EACf,iBAAe,KAAA,YAAY,KAAA;EAC3B,OAAK,eAAE,KAAA,MAAK;EACZ,OAAK,eAAA;GAAU,KAAA,GAAG,GAAE,YAAA,OAAA;GAA4B,KAAA,GAAG,GAAE,YAAa,KAAA,SAAQ;GAAS,KAAA,GAAG,GAAE,YAAa,KAAA,SAAQ;GAAS,KAAA,GAAG,GAAE,WAAY,KAAA,QAAO;GAAS,KAAA,GAAG,GAAE,YAAa,KAAA,SAAQ;GAAA,CAAA;EAOjL,aAAS,OAAA,OAAA,OAAA,MAAA,GAAA,SAAE,KAAA,aAAA,KAAA,UAAA,GAAA,KAAA;EACX,SAAK,OAAA,OAAA,OAAA,KAAA,eAAA,GAAA,SAAO,KAAA,qBAAA,KAAA,kBAAA,GAAA,KAAA,EAAiB,CAAA,OAAA,CAAA;EAAA,EAAA,CAE9B,WAEO,KAAA,QAAA,WAAA;EAFA,MAAM,KAAA;EAAO,OAAO,KAAA;EAAQ,UAAU,KAAA;EAAA,QAEtC,CADL,mBAAiC,QAAA,MAAA,gBAAxB,KAAA,SAAS,KAAA,KAAI,CAAA,EAAA,EAAA,CAAA,CAAA"}