@@ -4,6 +4,10 @@ import { Check, Info } from 'lucide-vue-next'
44import { CheckboxIndicator , CheckboxRoot , Primitive } from ' radix-vue'
55import { useStore } from ' @/stores'
66
7+ defineOptions ({
8+ inheritAttrs: false ,
9+ })
10+
711const store = useStore ()
812const { output, editor } = storeToRefs (store )
913
@@ -117,96 +121,98 @@ onBeforeMount(() => {
117121 </script >
118122
119123<template >
120- <Dialog v-model:open =" dialogVisible" @update:open =" onUpdate" >
121- <DialogTrigger >
122- <Button v-if =" !store.isMobile" variant =" outline" @click =" prePost" >
123- 发布
124- </Button >
125- </DialogTrigger >
126- <DialogContent >
127- <DialogHeader >
128- <DialogTitle >发布</DialogTitle >
129- </DialogHeader >
130- <Alert >
131- <Info class =" h-4 w-4" />
132- <AlertTitle >提示</AlertTitle >
133- <AlertDescription >
134- 此功能由第三方浏览器插件支持,本平台不保证安全性及同步准确度。
135- </AlertDescription >
136- </Alert >
137-
138- <Alert v-if =" !extensionInstalled" >
139- <Info class =" h-4 w-4" />
140- <AlertTitle >未检测到插件</AlertTitle >
141- <AlertDescription >
142- 请安装
143- <Primitive
144- as =" a" class =" text-blue-500" href =" https://www.wechatsync.com/?utm_source=syncicon#install"
145- target =" _blank"
146- >
147- 文章同步助手
148- </Primitive >
149- 插件
150- </AlertDescription >
151- </Alert >
152-
153- <div class =" w-full flex items-center gap-4" >
154- <Label for =" thumb" class =" w-10 text-end" >
155- 封面
156- </Label >
157- <Input id =" thumb" v-model =" form.thumb" placeholder =" 自动提取第一张图" />
158- </div >
159- <div class =" w-full flex items-center gap-4" >
160- <Label for =" title" class =" w-10 text-end" >
161- 标题
162- </Label >
163- <Input id =" title" v-model =" form.title" placeholder =" 自动提取第一个标题" />
164- </div >
165- <div class =" w-full flex items-start gap-4" >
166- <Label for =" desc" class =" w-10 text-end" >
167- 描述
168- </Label >
169- <Textarea id =" desc" v-model =" form.desc" placeholder =" 自动提取第一个段落" />
170- </div >
171-
172- <div class =" w-full flex items-start gap-4" >
173- <Label class =" w-10 text-end" >
174- 账号
175- </Label >
176- <div class =" flex flex-1 flex-col gap-2" >
177- <div v-for =" account in form.accounts" :key =" account.uid + account.displayName" class =" flex items-center gap-2" >
178- <label class =" flex flex-row items-center gap-4" >
179- <CheckboxRoot
180- v-model:checked =" account.checked"
181- class =" bg-background hover:bg-muted h-[25px] w-[25px] flex appearance-none items-center justify-center border border-gray-200 rounded-[4px] outline-hidden"
182- >
183- <CheckboxIndicator >
184- <Check v-if =" account.checked" class =" h-4 w-4" />
185- </CheckboxIndicator >
186- </CheckboxRoot >
187- <span class =" flex items-center gap-2 text-sm" >
188- <img
189- :src =" account.icon"
190- alt =" "
191- class =" inline-block h-[20px] w-[20px]"
124+ <div v-bind =" $attrs" >
125+ <Dialog v-model:open =" dialogVisible" @update:open =" onUpdate" >
126+ <DialogTrigger >
127+ <Button v-if =" !store.isMobile" variant =" outline" @click =" prePost" >
128+ 发布
129+ </Button >
130+ </DialogTrigger >
131+ <DialogContent >
132+ <DialogHeader >
133+ <DialogTitle >发布</DialogTitle >
134+ </DialogHeader >
135+ <Alert >
136+ <Info class =" h-4 w-4" />
137+ <AlertTitle >提示</AlertTitle >
138+ <AlertDescription >
139+ 此功能由第三方浏览器插件支持,本平台不保证安全性及同步准确度。
140+ </AlertDescription >
141+ </Alert >
142+
143+ <Alert v-if =" !extensionInstalled" >
144+ <Info class =" h-4 w-4" />
145+ <AlertTitle >未检测到插件</AlertTitle >
146+ <AlertDescription >
147+ 请安装
148+ <Primitive
149+ as =" a" class =" text-blue-500" href =" https://www.wechatsync.com/?utm_source=syncicon#install"
150+ target =" _blank"
151+ >
152+ 文章同步助手
153+ </Primitive >
154+ 插件
155+ </AlertDescription >
156+ </Alert >
157+
158+ <div class =" w-full flex items-center gap-4" >
159+ <Label for =" thumb" class =" w-10 text-end" >
160+ 封面
161+ </Label >
162+ <Input id =" thumb" v-model =" form.thumb" placeholder =" 自动提取第一张图" />
163+ </div >
164+ <div class =" w-full flex items-center gap-4" >
165+ <Label for =" title" class =" w-10 text-end" >
166+ 标题
167+ </Label >
168+ <Input id =" title" v-model =" form.title" placeholder =" 自动提取第一个标题" />
169+ </div >
170+ <div class =" w-full flex items-start gap-4" >
171+ <Label for =" desc" class =" w-10 text-end" >
172+ 描述
173+ </Label >
174+ <Textarea id =" desc" v-model =" form.desc" placeholder =" 自动提取第一个段落" />
175+ </div >
176+
177+ <div class =" w-full flex items-start gap-4" >
178+ <Label class =" w-10 text-end" >
179+ 账号
180+ </Label >
181+ <div class =" flex flex-1 flex-col gap-2" >
182+ <div v-for =" account in form.accounts" :key =" account.uid + account.displayName" class =" flex items-center gap-2" >
183+ <label class =" flex flex-row items-center gap-4" >
184+ <CheckboxRoot
185+ v-model:checked =" account.checked"
186+ class =" bg-background hover:bg-muted h-[25px] w-[25px] flex appearance-none items-center justify-center border border-gray-200 rounded-[4px] outline-hidden"
192187 >
193- {{ account.title }} - {{ account.displayName ?? account.home }}
194- </span >
195- </label >
188+ <CheckboxIndicator >
189+ <Check v-if =" account.checked" class =" h-4 w-4" />
190+ </CheckboxIndicator >
191+ </CheckboxRoot >
192+ <span class =" flex items-center gap-2 text-sm" >
193+ <img
194+ :src =" account.icon"
195+ alt =" "
196+ class =" inline-block h-[20px] w-[20px]"
197+ >
198+ {{ account.title }} - {{ account.displayName ?? account.home }}
199+ </span >
200+ </label >
201+ </div >
196202 </div >
197203 </div >
198- </div >
199-
200- <DialogFooter >
201- <Button variant =" outline" @click =" dialogVisible = false" >
202- 取 消
203- </Button >
204- <Button :disabled =" !allowPost" @click =" post" >
205- 确 定
206- </Button >
207- </DialogFooter >
208- </DialogContent >
209- </Dialog >
210204
211- <PostTaskDialog v-model:open =" postTaskDialogVisible" :post =" form" />
205+ <DialogFooter >
206+ <Button variant =" outline" @click =" dialogVisible = false" >
207+ 取 消
208+ </Button >
209+ <Button :disabled =" !allowPost" @click =" post" >
210+ 确 定
211+ </Button >
212+ </DialogFooter >
213+ </DialogContent >
214+ </Dialog >
215+
216+ <PostTaskDialog v-model:open =" postTaskDialogVisible" :post =" form" />
217+ </div >
212218</template >
0 commit comments