-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc4b17c
commit ab039db
Showing
5 changed files
with
2,256 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template> | ||
<div class="p-5 max-w-3xl mx-auto"> | ||
<!-- Content Editable Area --> | ||
<div | ||
ref="editor" | ||
class="border border-gray-300 p-3 rounded-md min-h-[200px] bg-white" | ||
contenteditable="true" | ||
@input="onInput" | ||
></div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue' | ||
const editor = ref(null) | ||
const htmlContent = ref('') | ||
// Function to execute formatting commands | ||
const execCommand = (command) => { | ||
document.execCommand(command, false, null) | ||
} | ||
// Watch for input changes | ||
const onInput = () => { | ||
htmlContent.value = editor.value.innerHTML | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
/* You can add custom styles here if needed */ | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.