You've already forked AstralRinth
forked from didirus/AstralRinth
Fix editor state issues (#173)
* Add MarkdownEditor component with default value and disabled option * Add editorThemeCompartment for customizing editor theme
This commit is contained in:
@@ -7,6 +7,10 @@ const description1 = ref(null);
|
||||
const description2 = ref(null);
|
||||
const description3 = ref(null);
|
||||
|
||||
const description4 = ref("Hello, world! This is a **bold** statement.");
|
||||
|
||||
const isDisabled = ref(false);
|
||||
|
||||
const onImageUpload = (file) => {
|
||||
return URL.createObjectURL(file).replace("blob:", "");
|
||||
};
|
||||
@@ -79,3 +83,34 @@ const description = ref(null)
|
||||
|
||||
<MarkdownEditor v-model="description" :heading-buttons="false" />
|
||||
```
|
||||
|
||||
## With default value
|
||||
<DemoContainer>
|
||||
<MarkdownEditor v-model="description4" />
|
||||
</DemoContainer>
|
||||
|
||||
```vue
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const description = ref("Hello, world! This is a **bold** statement.");
|
||||
</script>
|
||||
|
||||
<MardownEditor v-model="description" />
|
||||
```
|
||||
|
||||
## Disabled
|
||||
<DemoContainer>
|
||||
<Toggle v-model="isDisabled" label="Disabled" />
|
||||
<MarkdownEditor v-model="description" :disabled="isDisabled" />
|
||||
</DemoContainer>
|
||||
|
||||
```vue
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const description = ref(null);
|
||||
</script>
|
||||
|
||||
<MardownEditor v-model="description" disabled />
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user