ckeditor vue2_Ckeditor用于Vue.js 2

ckeditor vue2

维克迪克特 (vue-ckeditor)

Ckeditor using for Vue.js 2.

Ckeditor用于Vue.js 2。

要求 (Requirements)

安装 (Install)

CDN (CDN)

<script src="https://unpkg.com/vue-ckeditor2"></script>

NPM (NPM)

$ npm install vue-ckeditor2 --save

用法 (Usage)

This document applies to v2.0+. If you are looking for older versions, docs are here

本文档适用于v2.0 +。 如果您正在寻找较旧的版本,请在此处找到文档

import Vue from 'vue';
import VueCkeditor from 'vue-ckeditor2';

Vue.use(VueCkeditor);

Then in your component:

然后在您的组件中:

<template>
  <div>
    <vue-ckeditor v-model="content" :config="config" @blur="onBlur($event)" @focus="onFocus($event)" />
  </div>
</template>

<script>
export default {
  data () {
    return {
      content: '',
      config: {
        toolbar: [
          [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript' ]
        ],
        height: 300
      }
    }
  },
  methods: {
    onBlur (editor) {
      console.log(editor)
    },
    onFocus (editor) {
      console.log(editor)
    }
  }
}
</script>

道具 (Props)

NameTypeDescription
nameStringName of instance ckedior. Default: editor-1
idStringId of instance ckedior. Default: editor-1
typesStringTypes of ckedior. Default: classic
configObjectAll configuration of ckeditor. Default: {}
名称 类型 描述
name String 实例名称ckedior。 默认值:editer-1
id String 实例ckedior的ID。 默认值:editer-1
types String ckedior的类型。 默认值:经典
config Object ckeditor的所有配置。 默认值:{}

翻译自: https://vuejsexamples.com/ckeditor-using-for-vue-js-2/

ckeditor vue2

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值