From d1ccee8e5f2efdacf5f76ee254ae0bfd18c410aa Mon Sep 17 00:00:00 2001 From: heming <984507092@qq.com> Date: Mon, 29 Jul 2024 18:20:07 +0800 Subject: [PATCH] feat:emoji --- .../problem/emoji\346\217\222\344\273\266.md" | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 "docs/view/problem/emoji\346\217\222\344\273\266.md" diff --git "a/docs/view/problem/emoji\346\217\222\344\273\266.md" "b/docs/view/problem/emoji\346\217\222\344\273\266.md" new file mode 100644 index 0000000..5ece01a --- /dev/null +++ "b/docs/view/problem/emoji\346\217\222\344\273\266.md" @@ -0,0 +1,95 @@ +--- +name: 鹤鸣 +title: emoji +date: 2024-07-29 +--- + +# emoji 插件 V-Emoji-Picker + +npm 链接地址 + +vue3版本 + +```bash +yarn add v-emoji-picker + +or + +npm install v-emoji-picker +``` + +### 使用 + +```js + + + +// 引入组件 +import { VEmojiPicker } from 'v-emoji-picker' + +components: { + VEmojiPicker + }, + + + +// 方法 + // 将v-emoji-picker中选择的表情添加到评论内容中 + selectEmoji(emoji) { + this.newComment.content += emoji.data; + console.log(emoji) + }, +``` + +### Props + +```js +{ + @Prop({ default: () => [] }) customEmojis!: IEmoji[]; + @Prop({ default: () => [] }) customCategories!: ICategory[]; + @Prop({ default: 15 }) limitFrequently!: number; + @Prop({ default: 5 }) emojisByRow!: number; + @Prop({ default: false }) continuousList!: boolean; + @Prop({ default: 32 }) emojiSize!: number; + @Prop({ default: true }) emojiWithBorder!: boolean; + @Prop({ default: true }) showSearch!: boolean; + @Prop({ default: true }) showCategories!: boolean; + @Prop({ default: false }) dark!: boolean; + @Prop({ default: "Peoples" }) initialCategory!: string; + @Prop({ default: () => [] as ICategory[] }) exceptCategories!: ICategory[]; + @Prop({ default: () => [] as Emoji[] }) exceptEmojis!: IEmoji[]; + @Prop({}) i18n!: Object; +} +``` + +### Events + +```js +{ + select: 'Emit event on Selected Emoji', + changeCategory: 'Emit event on Change Category' +} +``` + +### Using custom Emojis + +Array of items with Interface IEmoji + +```js +interface IEmoji { + data: string; + category: string; + aliases: string[]; +} +``` + +### Using custom Categories + +Array of items with Interface ICategory + +```js +interface ICategory { + name: string; + icon: string; +} +```