This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

优化Neditor

old
宇天 2019-10-31 20:45:24 +08:00
parent 46ac8de0ee
commit d2a2c74bbb
1 changed files with 11 additions and 4 deletions

View File

@ -5,9 +5,11 @@
<div contenteditable="true" class="editor" spellcheck="false"></div> <div contenteditable="true" class="editor" spellcheck="false"></div>
</wc-scroll> </wc-scroll>
<div class="font-layer"> <div class="font-layer">
<span data-size="6">大号字体</span> <span data-size="6">6号字体</span>
<span data-size="5">中号字体</span> <span data-size="5">5号字体</span>
<span data-size="3">小号字体</span> <span data-size="4">4号字体</span>
<span data-size="3">3号字体</span>
<span data-size="2">2号字体</span>
</div> </div>
<div class="color-layer"> <div class="color-layer">
<span data-color="#f3f5fb"></span> <span data-color="#f3f5fb"></span>
@ -254,7 +256,8 @@ const DEFAULT_TOOLS = [
'center', 'center',
'right', 'right',
'link', 'link',
'image' 'image',
'topic'
] ]
function renderToolbar(list) { function renderToolbar(list) {
@ -425,6 +428,10 @@ export default class Neditor {
// 这里不作任何处理 // 这里不作任何处理
break break
case 'topic':
this.exec('insertHtml', '#话题#')
break
default: default:
this.__EDITOR__.focus() this.__EDITOR__.focus()
this.restoreSelection() this.restoreSelection()