Skip to content

Commit 4cc9016

Browse files
committed
更新
1 parent 08ff33a commit 4cc9016

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

src/App.vue

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,30 @@
4141

4242
<div class="py-2">
4343
<div class="pb-2 text-right">
44-
<ElButton type="primary" class="w-40">生成</ElButton>
44+
<ElButton
45+
type="primary"
46+
class="w-40"
47+
@click="handleCreate"
48+
>生成</ElButton
49+
>
4550
</div>
4651

4752
<div class="pb-2">
48-
<ElInput v-model="content" type="textarea"></ElInput>
53+
<ElInput
54+
v-model="content"
55+
type="textarea"
56+
disabled
57+
:rows="10"
58+
></ElInput>
4959
</div>
5060
<div class="text-right">
51-
<ElButton type="success" class="w-40">复制</ElButton>
61+
<ElButton
62+
type="success"
63+
class="w-40"
64+
@click="copy(content)"
65+
><span v-if="!copied">复制</span>
66+
<span v-else>已复制</span></ElButton
67+
>
5268
</div>
5369
</div>
5470
</ElCol>
@@ -124,6 +140,12 @@ const body = ref("");
124140
const footer = ref("");
125141
126142
const content = ref("");
143+
144+
const { text, copy, copied, isSupported } = useClipboard({
145+
source: content,
146+
});
147+
148+
const handleCreate = () => {};
127149
</script>
128150
<style lang="less" scoped>
129151
</style>

0 commit comments

Comments
 (0)