-
Notifications
You must be signed in to change notification settings - Fork 36
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
Showing
18 changed files
with
309 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ dist/ | |
coverage/ | ||
test-results | ||
cache | ||
.temp | ||
|
||
# local env | ||
.env.local | ||
|
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
35 changes: 35 additions & 0 deletions
35
packages/docs/fluent-editor/demos/code-block-highlight.vue
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,35 @@ | ||
<script setup lang="ts"> | ||
import { onMounted } from 'vue' | ||
import FluentEditor from '@opentiny/fluent-editor' | ||
let editor | ||
const TOOLBAR_CONFIG = [ | ||
[{ header: [] }], | ||
['bold', 'italic', 'underline', 'link'], | ||
[{ list: 'ordered' }, { list: 'bullet' }], | ||
['clean'], | ||
['code-block'] | ||
] | ||
onMounted(() => { | ||
// ssr compat, reference: https://vitepress.dev/guide/ssr-compat#importing-in-mounted-hook | ||
import('@opentiny/fluent-editor').then((module) => { | ||
const FluentEditor = module.default | ||
editor = new FluentEditor('#editor', { | ||
theme: 'snow', | ||
modules: { | ||
toolbar: { | ||
container: TOOLBAR_CONFIG | ||
}, | ||
syntax: true | ||
} | ||
}) | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div id="editor"></div> | ||
</template> |
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,35 @@ | ||
<script setup lang="ts"> | ||
import { onMounted } from 'vue' | ||
import FluentEditor from '@opentiny/fluent-editor' | ||
let editor | ||
const TOOLBAR_CONFIG = [ | ||
['undo', 'redo', 'clean'], | ||
[{ header: [1, 2, 3, 4, 5, 6, false] }, { size: ['12px', '14px', '16px', '18px', '20px', '24px', '32px', '36px', '48px', '72px']}], | ||
['bold', 'italic', 'strike', 'underline'], | ||
[{ color: [] }, { background: [] }], | ||
[{ align: [] }, { list: 'ordered' }, { list: 'bullet' }, { list: 'check' }], | ||
['link', 'blockquote', 'code', 'code-block'], | ||
] | ||
onMounted(() => { | ||
// ssr compat, reference: https://vitepress.dev/guide/ssr-compat#importing-in-mounted-hook | ||
import('@opentiny/fluent-editor').then((module) => { | ||
const FluentEditor = module.default | ||
editor = new FluentEditor('#editor', { | ||
theme: 'snow', | ||
modules: { | ||
toolbar: { | ||
container: TOOLBAR_CONFIG | ||
} | ||
} | ||
}) | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div id="editor"></div> | ||
</template> |
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,35 @@ | ||
<script setup lang="ts"> | ||
import { onMounted } from 'vue' | ||
import FluentEditor from '@opentiny/fluent-editor' | ||
let editor | ||
const TOOLBAR_CONFIG = [ | ||
[{ header: [] }], | ||
['bold', 'italic', 'underline', 'link'], | ||
[{ list: 'ordered' }, { list: 'bullet' }], | ||
['clean'], | ||
['emoji'] | ||
] | ||
onMounted(() => { | ||
// ssr compat, reference: https://vitepress.dev/guide/ssr-compat#importing-in-mounted-hook | ||
import('@opentiny/fluent-editor').then((module) => { | ||
const FluentEditor = module.default | ||
editor = new FluentEditor('#editor', { | ||
theme: 'snow', | ||
modules: { | ||
toolbar: { | ||
container: TOOLBAR_CONFIG | ||
}, | ||
'emoji-toolbar': true | ||
} | ||
}) | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div id="editor"></div> | ||
</template> |
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,35 @@ | ||
<script setup lang="ts"> | ||
import { onMounted } from 'vue' | ||
import FluentEditor from '@opentiny/fluent-editor' | ||
let editor | ||
const TOOLBAR_CONFIG = [ | ||
[{ header: [] }], | ||
['bold', 'italic', 'underline', 'link'], | ||
[{ list: 'ordered' }, { list: 'bullet' }], | ||
['clean'], | ||
['file'] | ||
] | ||
onMounted(() => { | ||
// ssr compat, reference: https://vitepress.dev/guide/ssr-compat#importing-in-mounted-hook | ||
import('@opentiny/fluent-editor').then((module) => { | ||
const FluentEditor = module.default | ||
editor = new FluentEditor('#editor', { | ||
theme: 'snow', | ||
modules: { | ||
toolbar: { | ||
container: TOOLBAR_CONFIG | ||
}, | ||
file: true | ||
} | ||
}) | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div id="editor"></div> | ||
</template> |
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,34 @@ | ||
<script setup lang="ts"> | ||
import { onMounted } from 'vue' | ||
import FluentEditor from '@opentiny/fluent-editor' | ||
let editor | ||
const TOOLBAR_CONFIG = [ | ||
[{ header: [] }], | ||
['bold', 'italic', 'underline', 'link'], | ||
[{ list: 'ordered' }, { list: 'bullet' }], | ||
['clean'], | ||
['image'] | ||
] | ||
onMounted(() => { | ||
// ssr compat, reference: https://vitepress.dev/guide/ssr-compat#importing-in-mounted-hook | ||
import('@opentiny/fluent-editor').then((module) => { | ||
const FluentEditor = module.default | ||
editor = new FluentEditor('#editor', { | ||
theme: 'snow', | ||
modules: { | ||
toolbar: { | ||
container: TOOLBAR_CONFIG | ||
} | ||
} | ||
}) | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div id="editor"></div> | ||
</template> |
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,47 @@ | ||
<script setup lang="ts"> | ||
import { onMounted } from 'vue' | ||
import FluentEditor from '@opentiny/fluent-editor' | ||
let editor | ||
// @提醒 | ||
const searchKey = 'name' | ||
const mentionList = [ | ||
{ | ||
name: 'Jack', | ||
age: 26, | ||
cn: 'Jack 杰克' | ||
}, | ||
{ | ||
name: 'Lucy', | ||
age: 22, | ||
cn: 'Lucy 露西' | ||
} | ||
] | ||
onMounted(() => { | ||
// ssr compat, reference: https://vitepress.dev/guide/ssr-compat#importing-in-mounted-hook | ||
import('@opentiny/fluent-editor').then((module) => { | ||
const FluentEditor = module.default | ||
editor = new FluentEditor('#editor', { | ||
theme: 'snow', | ||
modules: { | ||
mention: { | ||
itemKey: 'cn', | ||
searchKey, | ||
search: function(term) { | ||
return mentionList.filter(item => { | ||
return item[searchKey] && String(item[searchKey]).includes(term) | ||
}) | ||
} | ||
} | ||
} | ||
}) | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div id="editor"></div> | ||
</template> |
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,47 @@ | ||
<script setup lang="ts"> | ||
import { onMounted } from 'vue' | ||
import FluentEditor from '@opentiny/fluent-editor' | ||
let editor | ||
const TOOLBAR_CONFIG = [ | ||
[{ header: [] }], | ||
['bold', 'italic', 'underline', 'link'], | ||
[{ list: 'ordered' }, { list: 'bullet' }], | ||
['clean'], | ||
['better-table'] | ||
] | ||
onMounted(() => { | ||
// ssr compat, reference: https://vitepress.dev/guide/ssr-compat#importing-in-mounted-hook | ||
import('@opentiny/fluent-editor').then((module) => { | ||
const FluentEditor = module.default | ||
editor = new FluentEditor('#editor', { | ||
theme: 'snow', | ||
modules: { | ||
toolbar: { | ||
container: TOOLBAR_CONFIG | ||
}, | ||
'better-table': { | ||
operationMenu: { | ||
color: { | ||
text: '主题色', | ||
colors: [ | ||
'#ffffff', '#f2f2f2', '#dddddd', '#a6a6a6', '#666666', '#000000', | ||
'#c00000', '#ff0000', '#ffc8d3', '#ffc000', '#ffff00', '#fff4cb', | ||
'#92d050', '#00b050', '#dff3d2', '#00b0f0', '#0070c0', '#d4f1f5', | ||
'#002060', '#7030a0', '#7b69ee', '#1476ff', '#ec66ab', '#42b883', | ||
] | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div id="editor"></div> | ||
</template> |
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,4 @@ | ||
# 代码块高亮 | ||
|
||
:::demo src=demos/code-block-highlight.vue | ||
::: |
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,4 @@ | ||
# 自定义工具栏 | ||
|
||
:::demo src=demos/custom-toolbar.vue | ||
::: |
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,4 @@ | ||
# 表情 | ||
|
||
:::demo src=demos/emoji.vue | ||
::: |
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,4 @@ | ||
# 文件上传 | ||
|
||
:::demo src=demos/file-upload.vue | ||
::: |
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,4 @@ | ||
# 图片上传 | ||
|
||
:::demo src=demos/image-upload.vue | ||
::: |
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,4 @@ | ||
# @提醒 | ||
|
||
:::demo src=demos/mention.vue | ||
::: |
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,4 @@ | ||
# 表格 | ||
|
||
:::demo src=demos/table.vue | ||
::: |
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