Skip to content

PropertyListRoot ​

PropertyListRoot koordynuje interfejs właściwości przechowywanych jako tablica. Otrzymuje elementy i mieszany stan przez właściwości komponentu, emituje zmiany, a przez slot udostępnia działania dodawania, usuwania, zastępowania, częściowej aktualizacji i zmiany widoczności.

vue
<script setup lang="ts">
import { PropertyListRoot, useEditorPropertyList } from '@open-pencil/vue'
const fills = useEditorPropertyList('fills')
</script>

<template>
  <PropertyListRoot
    prop-key="fills"
    :items="fills.items.value"
    :mixed="fills.isMixed.value"
    @add="fills.actions.add"
    @remove="fills.actions.remove"
  />
</template>

PropertyListRoot

Generated from packages/vue/src/primitives/PropertyList/PropertyListRoot.vue

Props

PropDefaultType
propKey*
Discriminator that provides exact Fill, Stroke, or Effect types to slots and actions.
—K
items*
Controlled list items.
—PropertyListItemFor<K>[]
mixed
Marks values across the current selection as inconsistent.
falseboolean | undefined
disabled
Prevents item actions.
—boolean | undefined
getKey
Stable identity for keyed rows. Defaults to the item index.
—((item: PropertyListItemFor<K>, index: number) => PropertyListIdentity) | undefined
label
Optional accessible label exposed to consumers.
—string | undefined

Events

EventPayloadDescription
add[item: PropertyListItemFor<K>]
remove[index: number]
update[index: number, item: PropertyListItemFor<K>]
patch[index: number, changes: Partial<PropertyListItemFor<K>>]
toggleVisibility[index: number]
reorder[fromIndex: number, toIndex: number]

Slots

SlotPropsDescription
defaultPropertyListRootSlotProps<K>

PropertyListItem

Generated from packages/vue/src/primitives/PropertyList/PropertyListItem.vue

Props

PropDefaultType
propKey*—K
index*—number
draggingfalseboolean | undefined
disabled—boolean | undefined
as"div"string | Component | undefined
asChildfalseboolean | undefined

Events

EventPayloadDescription
update[index: number, item: PropertyListItemFor<K>]
patch[index: number, changes: Partial<PropertyListItemFor<K>>]
remove[index: number]
toggleVisibility[index: number]

Slots

SlotPropsDescription
defaultPropertyListItemSlotProps<K>

PropertyListAdd

Generated from packages/vue/src/primitives/PropertyList/PropertyListAdd.vue

Props

PropDefaultType
propKey*
Must match the nearest PropertyListRoot and preserves generic inference.
—K
as
Element or component rendered by this part.
"button"string | Component | undefined
asChild
Merge behavior into the single child element.
falseboolean | undefined
disabled
Prevent activation.
—boolean | undefined
item*—PropertyListItemFor<K>

Events

EventPayloadDescription
add[item: PropertyListItemFor<K>]

Slots

SlotPropsDescription
default{}

PropertyListRemove

Generated from packages/vue/src/primitives/PropertyList/PropertyListRemove.vue

Props

PropDefaultType
propKey*
Must match the nearest PropertyListRoot and preserves generic inference.
—K
as
Element or component rendered by this part.
"button"string | Component | undefined
asChild
Merge behavior into the single child element.
falseboolean | undefined
disabled
Prevent activation.
—boolean | undefined
index*—number

Events

EventPayloadDescription
remove[index: number]

Slots

SlotPropsDescription
default{}

PropertyListVisibility

Generated from packages/vue/src/primitives/PropertyList/PropertyListVisibility.vue

Props

PropDefaultType
propKey*
Must match the nearest PropertyListRoot and preserves generic inference.
—K
as
Element or component rendered by this part.
"button"string | Component | undefined
asChild
Merge behavior into the single child element.
falseboolean | undefined
disabled
Prevent activation.
—boolean | undefined
index*—number

Events

EventPayloadDescription
toggle[index: number]

Slots

SlotPropsDescription
default{ visible: boolean; }

Released under the MIT License.