You can use Yarn or NPM
$ npm install --save trix-vue2
OR
yarn add trix-vue2
import { TrixVue } from 'trix-vue2'
//... your code
Name | Type | Default | Description |
---|---|---|---|
id | String | trix-container | Set the id (necessary if multiple editors in the same view) |
inputId | String | - | Set inputId when you want to embed trix editor inside a form. |
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>
MIT