docs(components): [mention] add an example of using props (#22139)

This commit is contained in:
Rainbow
2025-09-13 07:53:04 +08:00
committed by GitHub
parent 75322df994
commit a4d6fe2cb4
2 changed files with 46 additions and 0 deletions

View File

@@ -17,6 +17,16 @@ mention/basic
:::
## Props ^(2.11.3)
You can customize the alias of the `options` through the `props` attribute.
:::demo
mention/props
:::
## Textarea
The input type can be set to `textarea`.

View File

@@ -0,0 +1,36 @@
<template>
<el-mention
v-model="value"
:options="options"
:props="props"
style="width: 320px"
placeholder="Please input"
/>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const value = ref('@')
const props = { label: 'name', value: 'id', disabled: 'unable' }
const options = ref([
{
name: 'Fuphoenixes',
id: 'Fuphoenixes',
unable: true,
},
{
name: 'kooriookami',
id: 'kooriookami',
},
{
name: 'Jeremy',
id: 'Jeremy',
unable: true,
},
{
name: 'btea',
id: 'btea',
},
])
</script>