
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@kyfe/ks-editor
Advanced tools
npm i @kyfe/ks-editor
import ksEditor from '@kyfe/ks-editor'
Vue.use(ksEditor)
<ks-editor ref="editDom"
:audioDetail="audioData"
:editorConfig="editorConfig"
:tag="666"
placeholder="请输入"
@focus="handlefocus"
@audioChange="audioChange"
@blur="handleBlur"
@input="handleInput"/>
this.$refs['editdom'].getHtmlContent() // 获取文本内容
this.$refs['editdom'].setHtmlContent('hello world') // 设置文本内容
入参 | 说明 | 是否必填 |
---|---|---|
editorConfig | 快捷工具栏配置 | 必填 |
audioDetail | 语音信息 | 非必填 |
tag | 同一个页面初始化多个ks-editor时区分使用 | 非必填 |
事件名 | 说明 |
---|---|
audioChange | 监听语音回调事件 |
focus | 监听聚焦事件 |
blur | 监听失去焦点事件 |
input | 监听输入事件 |
audioDetail
// 监听语音回调事件
audioChange (data) {
this.audioData = data
},
// 语音数据结构
audioDetail = {
bizId,
length
}
editorConfig
editorConfig = [
{
key: 'audio',
label: '语音',
iconUrl: 'tool-audio.png', // 建议用base64
},
{
key: 'style', // 富文本样式操作面板
label: '样式',
iconUrl: 'tool-style.png', // 建议用base64
isShowHistory: true, // 是否展示撤回/恢复功能悬浮按钮
maxLength: 700 // 富文本字数限制
},
{
key: 'bold',
label: '加粗',
isRichEditorOption: true, // 是否富文本内置选项
},
{
key: 'listOrdered',
label: '序列',
isRichEditorOption: true, // 是否富文本内置选项
},
{
key: 'color',
label: '颜色',
isRichEditorOption: true, // 是否富文本内置选项
// 颜色气泡快捷键
colorPops: [
// black
'#333333',
// red,
'#f92b2d',
// yellow,
'#ffbe00',
],
},
{
key: 'emoji',
label: '表情',
iconUrl: 'emoji.png',
},
// 以上为内置选项,如需自定义功能请使用formatter
{
key: 'confirm', // key需保持唯一
formatter: () => {
return (
<div class="mini-toolbar-item" onClick={this.confirmExitAndSave}>
<span class="btn-label confirm-btn">保存</span>
</div>
)
}
}
]
FAQs
The npm package @kyfe/ks-editor receives a total of 0 weekly downloads. As such, @kyfe/ks-editor popularity was classified as not popular.
We found that @kyfe/ks-editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.