Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

five-editor

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

five-editor

ckEditor5 自定义编辑器.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ckeditor5 富文本编辑器

概述

这是一个自用的 ckeditor5 富文本编辑器,基于 build-classic 修改。

当前修改内容

  • 工具栏去掉 图片、视频、表格
  • 添加字数统计插件
  • 添加文字样式插件
  • 添加表情包

如何使用?

安装

npm install five-editor npm install @ckeditor/ckeditor5-vue

main.ts:
import CKEditor from '@ckeditor/ckeditor5-vue'
...
createApp(App).use(router).use(CKEditor)
...

富文本编辑器组件:
<template>
  <div id="app">
    <ckeditor
      :editor="ClassicEditor"
      v-model="valueHtml"
      :config="editorConfig"
    >
    </ckeditor>
    <div v-if="maxCharacters" class="float-right text-#707070">
      {{ characters }} / {{ maxCharacters }}
    </div>
  </div>
</template>

<script setup lang="ts">
import ClassicEditor from 'five-editor'

const props = defineProps<{
  value: string
  placeholder?: string
  maxCharacters?: number
  characters: number
}>()
const emit = defineEmits<{
  (e: 'update:value', val: string): void
  (e: 'update:characters', val: number): void
}>()
const valueHtml = computed({
  get() {
    return props.value
  },
  set(val: string) {
    emit('update:value', val)
  }
})

const editorConfig = ref({
  placeholder: props.placeholder,
  wordCount: {
    onUpdate: (stats) => {
      emit('update:characters', stats.characters)
    }
  }
})
</script>


样式

案例

Keywords

FAQs

Package last updated on 21 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc