• This repository has been archived on 05/Dec/2020
  • Stars
    star
    236
  • Rank 170,480 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 4 years ago

Reviews

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

Repository Details

Vue.js component for Trumbowyg WYSIWYG editor πŸ“

Vue Trumbowyg

downloads npm-version github-tag build license

Vue.js component for Trumbowyg WYSIWYG editor

Demo or JSFiddle

Version matrix

Vue.js version Package version Branch
2.x 3.x 3.x
3.x 4.x master

Installation

# yarn
yarn add vue-trumbowyg

# npm
npm install vue-trumbowyg 

Features

  • Reactive v-model value
    • You can change editor value programmatically
  • Emits all possible events
  • Supports most plugins
  • Works with validation libraries like - vee-validate

Requirements

  • jQuery >=1.8
  • Vue v3.x

Usage

<template>
  <div>
    <trumbowyg v-model="content" :config="config" class="form-control" name="content"></trumbowyg>
  </div>
</template>

<script>  
  // Import this component
  import Trumbowyg from 'vue-trumbowyg';
  
  // Import editor css
  import 'trumbowyg/dist/ui/trumbowyg.css';
   
  export default {    
    data () {
      return {
        content: null,
        config: {
          // Get options from 
          // https://alex-d.github.io/Trumbowyg/documentation
        }       
      }
    },
    components: {
      Trumbowyg
    }
  }
</script>

As plugin

  import Vue from 'vue';
  import VueTrumbowyg from 'vue-trumbowyg';
  import 'trumbowyg/dist/ui/trumbowyg.css';
  app.use(VueTrumbowyg);

This will register a global component <trumbowyg>

Events

  • You can listen to various events like this
 <trumbowyg v-model="body" @tbw-blur="yourMethod"></trumbowyg>
  • πŸ’‘ Events names are prefixed with tbw and separated with a dash, for example: tbw-focus

Available props

The component accepts these props:

Attribute Type Default Description
v-model String / null null Set or Get editor value (required)
disabled Boolean false Enable/disable editor
config Object {} Editor configuration options
svg-path String, Boolean import 'trumbowyg/dist/ui/icons.svg' Set custom svg icon file URL

Install in non-module environments (without webpack)

<!-- Editor dependencies-->
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

<!-- Editor itself -->
<script src="https://cdn.jsdelivr.net/npm/trumbowyg@2"></script>
<link href="https://cdn.jsdelivr.net/npm/trumbowyg@2/dist/ui/trumbowyg.min.css" rel="stylesheet">

<!-- Vue js -->
<script src="https://cdn.jsdelivr.net/npm/vue@3"></script>
<!-- Lastly add this package -->
<script src="https://cdn.jsdelivr.net/npm/vue-trumbowyg@4"></script><
<script>
  // Initialize as global component
  yourAppInstance.component('Trumbowyg', VueTrumbowyg.default);
</script>

Troubleshoot

Run examples on your localhost

  • Clone this repo
  • Make sure you have node-js >=10.13 and yarn >=1.x pre-installed
  • Install dependencies - yarn install
  • Run webpack dev server - yarn start
  • This should open the demo page at http://localhost:9000 in your default web browser

Changelog

Please see CHANGELOG for more information what has changed recently.

License

MIT License

More Repositories

1

vue-loading-overlay

Vue.js component for full screen loading indicator πŸŒ€
JavaScript
1,219
star
2

vue-flatpickr-component

Vue.js component for Flatpickr datetime picker πŸ“†
TypeScript
964
star
3

vue-toast-notification

Yet another toast notification plugin for Vue.js 🌷
JavaScript
615
star
4

vue-cleave-component

Vue.js component for Cleave.js input mask library ⌨️
JavaScript
281
star
5

vue-bootstrap-datetimepicker

Vue.js component for eonasdan bootstrap datetimepicker
JavaScript
224
star
6

google-chat-electron

An unofficial desktop app for Google Chat :electron:
TypeScript
158
star
7

vue-web-storage

Vue.js plugin for local storage and session storage (1.8 kb min+gz) πŸ’Ύ
TypeScript
85
star
8

fcm-notification-channel

All in One Firebase push notification channel for Laravel πŸ””
PHP
68
star
9

laravel-eloquent-relationships

Add some more eloquent relationships to Laravel php framework. πŸ‘«
PHP
57
star
10

phpunit-travis-ci-coverage-example

phpUnit Testing on Travis-CI with Code Coverage on CodeCov
PHP
28
star
11

laravel-mix-auto-extract

[DEPRECATED] Laravel Mix v2/3 plugin to auto extract vendor js
JavaScript
25
star
12

laravel-ses-webhooks

AWS SES Webhooks client for Laravel πŸ“¬
PHP
22
star
13

laravel-socialite-multiple-providers-example

Laravel socialite with multiple providers example
PHP
20
star
14

vue-jquery-mask

Vue.js component for jQuery mask plugin
JavaScript
20
star
15

vue-lunch-order-app

Lunch order app, built with Vue.js v2 and Google Spreadsheet
JavaScript
17
star
16

laravel-paypal-webhooks

Handle PayPal webhooks in Laravel πŸ’΅
PHP
16
star
17

bandwidth-notification-channel

Bandwidth SMS notification channel for Laravel php framework πŸ“©
PHP
12
star
18

wp-google-map

Google Map Plugin for WordPress
PHP
11
star
19

laravel-bundler

Modern asset building tool for Laravel framework with better defaults. πŸ“¦
JavaScript
11
star
20

codeception-travis-ci-example

[READ-ONLY] Codeception Acceptance Testing on Travis-CI
PHP
9
star
21

wp-prism-js

Prism Syntax Highlighter Plugin for WordPress
PHP
7
star
22

vue-bugsnag

[DEPRECATED] Vue.js plugin for Bugsnag js v3.x error reporting
JavaScript
6
star
23

vue-progress-indicator

Vue.js component for progress indicator
JavaScript
5
star
24

electron-update-notifier

Update notifier for Electron apps πŸ””
TypeScript
5
star
25

laravel-form-validation

Yet another form validation (JS) helper for Laravel. β˜‚οΈ
TypeScript
5
star
26

laravel-blogger-api-example

Laravel demo blog REST api πŸ§™β€β™‚οΈ
PHP
4
star
27

laravel-stripe-exceptions

Handle Stripe exceptions gracefully in Laravel php framework. β˜„οΈ
PHP
4
star
28

node-webkit-angular-starter-kit

[READ-ONLY] A node-webkit and Angular js based desktop app
JavaScript
3
star
29

laravel-alert

A Bootstrap alert helper for Laravel php framework πŸ₯­
PHP
3
star
30

laravel-lunch-order-app

[WIP] Lunch order app built with Laravel
PHP
2
star
31

laravel-vonage-inbound-sms

Vonage Inbound SMS Webhooks Client for Laravel ☎️
PHP
2
star
32

wp-google-analytics

Google Analytics Plugin for WordPress
PHP
2
star
33

gulp-3-browsersync-scss-seed

[READ-ONLY] Front-end development starter kit for beginners
JavaScript
2
star
34

vue-php-demo-2021

Sample app to demo vue.js with php
PHP
2
star
35

laravel-otp

One time password (OTP) generator and verifier for Laravel πŸ“²
PHP
2
star
36

ankurk91.github.io

Ankur Kumar's GitHub Profile πŸŽ‰
HTML
1
star
37

ankurk91

The README repo πŸ˜‰
1
star
38

laravel-passport-socialite-example

Laravel passport with socialite
PHP
1
star
39

laravel-shopping-cart

Shopping cart manager for Laravel. πŸ›’
PHP
1
star
40

wp-tabs-example

WordPress plugin to demonstrate how to use in-built tabs on plugin options page
PHP
1
star
41

wp-lazy-intercom

WordPress plugin to lazy load Intercom widget
PHP
1
star
42

wp-screen-options-example

WordPress plugin to demonstrate screen options usage in your plugin options page
PHP
1
star