@@ -34,6 +34,10 @@ const deleteNote = () => {
3434 emit (" delete" );
3535};
3636
37+ const handleCopy = () => {
38+ copyToClipboard (props .note .content || props .note .title );
39+ };
40+
3741const limitText = (text : string , limit : number ) => {
3842 return text .length > limit ? text .slice (0 , limit ) + " ..." : text ;
3943};
@@ -52,7 +56,7 @@ const limitText = (text: string, limit: number) => {
5256
5357 <div
5458 class =" text-background/95 text-sm font-semibold"
55- @click =" editNote() "
59+ @click =" editNote"
5660 >
5761 {{ limitText(props.note?.title, 25) || "Untitled" }}
5862 </div >
@@ -61,21 +65,21 @@ const limitText = (text: string, limit: number) => {
6165 <!-- actions -->
6266 <div class =" flex items-center space-x-2 text-background/75" >
6367 <button
64- @click =" copyToClipboard(props.note.content || props.note.title) "
68+ @click =" handleCopy "
6569 title =" Copy to clipboard"
6670 class =" hover:text-vue-green transition-colors cursor-pointer"
6771 >
6872 <Icon name =" mdi:clipboard" size =" 22" />
6973 </button >
7074 <button
71- @click =" editNote() "
75+ @click =" editNote"
7276 title =" Edit note"
7377 class =" hover:text-vue-green transition-colors cursor-pointer"
7478 >
7579 <Icon name =" mdi:edit" size =" 22" />
7680 </button >
7781 <button
78- @click =" deleteNote() "
82+ @click =" deleteNote"
7983 title =" Delete note"
8084 class =" hover:text-vue-green transition-colors cursor-pointer"
8185 >
@@ -86,7 +90,7 @@ const limitText = (text: string, limit: number) => {
8690
8791 <p
8892 class =" mt-2 text-gray-500 text-sm font-light leading-relaxed"
89- @click =" editNote() "
93+ @click =" editNote"
9094 >
9195 {{ limitText(props.note?.content, 50) || "No content available." }}
9296 </p >
0 commit comments