Skip to content
API 风格:

Mentions 멘션 ​

LhMentions @멘션 입력.

기본 사용법 ​

기본 사용법
vue
<script setup lang="ts">
import { ref } from 'vue'
import { LhMentions } from '@lh-ui/vue3'

const text = ref('')
const members = [
  { label: '김민수' },
  { label: '이영희' },
  { label: '박철수' },
]
const t1 = {
  placeholder: '@로 멤버 멘션',
}
</script>

<template>
<LhMentions v-model="text" :options="members" :placeholder="t1.placeholder" />
</template>
vue
<script>
import { LhMentions } from '@lh-ui/vue3'

export default {
  components: { LhMentions },
  data() {
    return {
      text: '',
      members: [
      { label: '김민수' },
      { label: '이영희' },
      { label: '박철수' },
    ],
      t1: {
      placeholder: '@로 멤버 멘션',
    },
    }
  },
}
</script>

<template>
<LhMentions v-model="text" :options="members" :placeholder="t1.placeholder" />
</template>
여러 줄 모드
vue
<script setup lang="ts">
import { ref } from 'vue'
import { LhMentions } from '@lh-ui/vue3'

const text2 = ref('')
const t2 = {
  placeholder2: '여러 줄 @ 멘션',
}
</script>

<template>
<LhMentions v-model="text2" :options="members" multiline :placeholder="t2.placeholder2" />
</template>
vue
<script>
import { LhMentions } from '@lh-ui/vue3'

export default {
  components: { LhMentions },
  data() {
    return {
      text2: '',
      t2: {
      placeholder2: '여러 줄 @ 멘션',
    },
    }
  },
}
</script>

<template>
<LhMentions v-model="text2" :options="members" multiline :placeholder="t2.placeholder2" />
</template>

Mentions API ​

속성 ​

이름설명타입기본값
modelValue텍스트 콘텐츠string''
options멤버 옵션LhMentionOption[][]
prefix트리거 문자string'@'
placeholder플레이스홀더string''
disabled비활성화booleanfalse
multiline여러 줄 모드booleanfalse
ariaLabel접근성 이름string—
sx빠른 레이아웃LhSxProps—

이벤트 ​

이름설명타입
update:modelValue텍스트 변경 시 발생(value: string)
change텍스트 변경 시 발생(value: string)
select멘션 선택 시 발생(option: LhMentionOption)

슬롯 ​

이름설명
empty일치 항목 없음 상태

접근성 ​

  • 입력은 role="combobox"
  • 이메일 오탐지 방지

국풍의 아름다움으로 코드의 토대를 세웁니다