1.0.1 • Published 7 years ago

trix-vue2 v1.0.1

Weekly downloads
86
License
MIT
Repository
github
Last release
7 years ago

TrixVue Editor

trix vue

Install

You can use Yarn or NPM

$ npm install --save trix-vue2

OR

yarn add trix-vue2

Usage

import { TrixVue } from 'trix-vue2'

//... your code

Props

NameTypeDefaultDescription
idStringtrix-containerSet the id (necessary if multiple editors in the same view)
inputIdString-Set inputId when you want to embed trix editor inside a form.

Example

Basic Setup

<template>
  <div id="app">
    <div>
      <h1>TrixVue Editor</h1>
      <h3>1. Simple TrixVue example:</h3>
      <trix-vue></trix-vue>
    </div>
  </div>
</template>

<script>
  import { TrixVue } from '../src/index.js'

  export default {
    components: {
      TrixVue,
    }
  }
</script>

Use inside a form

<template>
  <div id="app">
    <div>
      <h1>TrixVue Editor</h1>
      <h3>2. TrixVue inside form:</h3>
      <form id="cool-form">
        <input id="x" value="Editor content goes here" type="hidden" name="content">
        <trix-vue inputId="x"></trix-vue>
      </form>
    </div>
  </div>
</template>

<script>
  import { TrixVue } from '../src/index.js'

  export default {
    components: {
      TrixVue,
    }
  }
</script>

License

MIT