百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
V

vue-html-editor

> 编程语言
开源

Vue.js 组件使用 jQuery summernote 插件执行 HTML 编辑器 .

384 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

Vue.js 组件使用 jQuery summernote 插件执行 HTML 编辑器 .

vue-html-editor

A Vue.js component implementing the HTML editor with the jQuery summernote plugin.

Demo

The demo page is HERE.

Requirements

  • Vue.js ^1.0.24
  • Summernote ^0.8.1

Instllation

npm

bash
$ npm install vue-html-editor

bower

bash
$ bower install vue-html-editor

Usage

The HTML snippets are as follows:

xml

    

    

  

The Javascript snippets are as follows:

javascript
var Vue = require("vue");

var vm = new Vue({
  el: "#app",
  components: {
    "vue-html-editor": require("vue-html-editor")
  },
  data: {
    text: "Hello World!"
  }
});

Component Properties

model

The model bind to the control, which must be a two way binding variable.

Note that the value of model could be set to null, and in that case the text content of the editor will be set to an empty string. While, if the text content of the editor is set to empty, the value of the model will be set to null instead of an empty string.

language

The optional code of language used by the summernote plugin. Default value is 'en-US'. Note that the language code passed to this property must be a language code together with a country code. This limitation is due to names of the i18n localizaiton files of the summernote plugin.

height

The optional height of the HTML editor, in pixels. Default value is 160.

minHeight

The optional minimum height of the HTML editor, in pixels. Default value is 160.

maxHeight

The optional maximum height of the HTML editor, in pixels. Default value is 800.

name

The optional name of the textarea control.

toolbar

The optional configuration of toolbar of the HTML editor. This value will be passed to the constructor of the summernote directly. Default value is as follows

[
  ["font", ["bold", "italic", "underline", "clear"]],
  ["fontsize", ["fontsize"]],
  ["para", ["ul", "ol", "paragraph"]],
  ["color", ["color"]],
  ["insert", ["link", "picture", "hr"]]
]

API

control

This property is a reference to the JQuery selection of the base texearea control. It could be used to call the APIs of summernote. For example, editor.control.code(val) will set the HTML content of the editor to the specified value, where editor is the reference to the vue-html-editor component.

Contributing

  • Fork it !
  • Create your top branch from dev: git branch my-new-topic origin/dev
  • Commit your changes: git commit -am 'Add some topic'
  • Push to the branch: git push origin my-new-topic
  • Submit a pull request to dev branch of Haixing-Hu/vue-html-editor repository !

Building and Testing

First you should install all depended NPM packages. The NPM packages are used for building and testing this package.

bash
$ npm install

Then install all depended bower packages. The bower packages are depended by this packages.

bash
$ bower install

Now you can build the project.

bash
$ gulp build

The following command will test the project.

bash
$ gulp test

The following command will perform the test and generate a coverage report.

bash
$ gulp test:coverage

The following command will perform the test, generate a coverage report, and upload the coverage report to coveralls.io.

bash
$ gulp test:coveralls

You can also run bower install and gulp build together with the following command:

bash
npm run build

Or run bower install and gulp test:coveralls together with the following command:

bash
npm run test

License

The MIT License

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言