• Stars
    star
    389
  • Rank 110,500 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

vue-html-editor

Build Status Coverage Status bitHound Score Dependency Status devDependency Status

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

Demo

The demo page is HERE.

Screenshot

Requirements

Instllation

npm

$ npm install vue-html-editor

bower

$ bower install vue-html-editor

Usage

The HTML snippets are as follows:

<div class="container" id="app">
  <vue-html-editor name="html-editor" :model.sync="text"></vue-html-editor>
  <div style="margin-top:40px">
    <div> The HTML contents are as follows:</div>
    <hr>
    <div >{{{text}}}</div>
  </div>
</div>

The Javascript snippets are as follows:

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.

$ npm install

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

$ bower install

Now you can build the project.

$ gulp build

The following command will test the project.

$ gulp test

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

$ gulp test:coverage

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

$ gulp test:coveralls

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

npm run build

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

npm run test

License

The MIT License

More Repositories

1

typesetting-standard

中文排版所需遵循的标准和规范
626
star
2

nju-thesis

南京大学学位论文XeLaTeX模板
TeX
406
star
3

vue-datetime-picker

A Vue.js component implementing the datetime picker control using the Eonasdan's bootstrap datetime picker plugin.
JavaScript
343
star
4

GBT7714-2005-BibTeX-Style

A GB/T 7714-2005 national standard compliant BibTeX style.
TeX
326
star
5

latex-chinese-fonts

Simplified Chinese fonts for the LaTeX typesetting.
180
star
6

vue-select

A Vue.js component implementing the select control with the jQuery select2 plugin.
JavaScript
134
star
7

vue-i18n

Internationalization plugin of Vue.js
JavaScript
62
star
8

vue-country-select

A Vue.js component implementing the select control used to select countries.
JavaScript
49
star
9

gift-to-lover

A personal gift to my lover.
JavaScript
33
star
10

xelatex-zh-book

An XeLaTeX document style for typesetting Simplified Chinese books.
TeX
24
star
11

vue-format

A Vue.js plugin for formatting messages.
JavaScript
19
star
12

bootstrap3-ie10-viewport-bug-workaround

The official workaround of the viewport bug of IE 10.0 for the bootstrap 3.
JavaScript
16
star
13

javafx-widgets

The useful widgets for JavaFX
Java
14
star
14

swt-widgets

Collect some useful SWT widgets for my applications.
Java
12
star
15

vue-titlecase

A Vue.js filter used to make a string titlecased.
JavaScript
12
star
16

nju-report

南京大学科技报告XeLaTeX模板
Shell
8
star
17

HanZi-Learning-ANKI-Cards

供儿童学习认识汉字的ANKI卡片模板及其生成器
Python
6
star
18

datatables-i18n

The i18n files of the datatables, renamed with the standard language identifiers, and registered in the bower.
5
star
19

animated-header.js

A fixed header that will animate its size on scroll.
HTML
3
star
20

vue3-class-component

The new vue-class-component for Vue3.
JavaScript
3
star
21

dqwl

Simulation of Discrete Quantum Walk on a Line using the Matlab.
MATLAB
3
star
22

beamer-chinese-translation

Translation of the LaTeX beamer package into Simplified/Traditional Chinese
Shell
3
star
23

qwViz

Visualisation of quantum walks on graphs
C
2
star
24

quantum-walk

The matlab simulator of quantum walks
MATLAB
2
star
25

commons

The common utilities used in Java programming.
Java
2
star
26

Haixing-Hu.github.io

The homepage of Haixing Hu.
Ruby
2
star
27

criteria

A collection of classes used to representing filtering/searching criteria.
Java
2
star
28

iLibrary

A multi-platform personal digit library software.
Java
1
star