1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-09-12 16:40:40 +08:00
Files
uni-halo/.agents/skills/uview-pro-vue3/api/props-and-events.md
T
2026-08-31 07:58:23 +08:00

1.3 KiB

Props and Events

API Reference

Common props and events in uView Pro components.

Common Props

custom-class

Type: string

Custom CSS class name.

custom-style

Type: string | object

Custom inline style.

disabled

Type: boolean

Default: false

Whether component is disabled.

Common Events

@click

Type: Function

Click event handler.

Example:

<u-button @click="handleClick">Button</u-button>

@change

Type: Function

Change event handler.

Example:

<u-input v-model="value" @change="handleChange" />

@focus

Type: Function

Focus event handler.

Example:

<u-input @focus="handleFocus" />

@blur

Type: Function

Blur event handler.

Example:

<u-input @blur="handleBlur" />

Event Object

Event handlers receive an event object:

handleEvent(event) {
  // event.target - Target element
  // event.currentTarget - Current target element
  // event.detail - Event detail (component-specific)
}

Component-Specific Events

Different components emit different events:

  • Input: @input, @change, @focus, @blur
  • Select: @change, @open, @close
  • Form: @validate
  • Button: @click

See also: examples/components/ for component-specific examples