mirror of
https://github.com/keven1024/015.git
synced 2026-06-03 02:49:36 +00:00
feat(front): implement text sharing functionality with new TextShareHandle and TextShareResult components
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { LucideShare, LucideImage, LucideBot, LucideLanguages } from 'lucide-vue-next'
|
||||
import { cx } from 'class-variance-authority'
|
||||
import showDrawer from '~/lib/showDrawer';
|
||||
import TextShareHandle from '~/components/Preprocessing/TextShareHandle.vue';
|
||||
|
||||
const props = defineProps<{
|
||||
hide: () => void
|
||||
text: string
|
||||
onTextHandle: ({ type, config }: { type: string, config: any }) => void
|
||||
}>()
|
||||
const actions = [
|
||||
{
|
||||
label: '分享文本', icon: LucideShare, className: 'bg-green-300', onClick: () => {
|
||||
console.log('复制链接')
|
||||
showDrawer({ render: ({ hide }) => h(TextShareHandle, { ...props, hide }) })
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -31,9 +35,9 @@ const actions = [
|
||||
<template>
|
||||
<div class="flex flex-col gap-5 p-5">
|
||||
<div class="flex flex-row gap-5">
|
||||
<div v-for="item in actions" :key="item.label" class="flex flex-col items-center gap-2" @click="()=>{
|
||||
item?.onClick()
|
||||
<div v-for="item in actions" :key="item.label" class="flex flex-col items-center gap-2" @click="() => {
|
||||
props?.hide()
|
||||
item?.onClick()
|
||||
}">
|
||||
<div :class="cx('size-14 flex justify-center items-center rounded-full', item?.className)">
|
||||
<component :is="item?.icon" />
|
||||
|
||||
Reference in New Issue
Block a user