Skip to content

witIconSelector Icon Selector

witIconSelector is an icon selector component built based on Vue 3 and Element Plus, provides rich icon library, search functionality and pagination display, helps users quickly select needed icons.

Usage Example

Basic Usage

vue
<template>
  <div class="icon-selector-container">
    <wit-icon-selector @handle-icon="handleSelectIcon" />
  </div>
</template>

<script lang="ts" setup>
import { witIconSelector } from './plugins/witIconSelector'

// Handle icon selection event
const handleSelectIcon = (iconName) => {
  console.log('Selected icon:', iconName)
  // Handle icon selection logic
}
</script>

<style scoped>
.icon-selector-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}
</style>

API

Component

Component NameDescription
witIconSelectorIcon selector component, provides icon search and selection functionality

Properties

Property NameTypeDefault ValueDescription
modelValueString'ri-24-hours-fill'Currently selected icon name
placeholderString''Search box placeholder
pageSizeNumber20Number of icons displayed per page
layoutString'total, prev, next'Pagination layout

Events

Event NameDescriptionParameters
handle-iconTriggered when icon is selectedSelected icon name (String)

湘ICP备2024070110号