Skip to content

Plug-in

Rich Text Editor

If you need to use a rich text editor, you need to import vue2-editor ↗ separately.

javascript
import VueEditor from "vue2-editor"

Vue.use(VueEditor)

Internet Explorer 10 will not be supported if this component is included

Code Editor

Code editor using [ace ↗] (https://github.com/ajaxorg/ace), if you need to use the code in the project editor function, need to be registered FormMaking components configuration ace address, as follows:

javascript
Vue.use(FormMaking, {
  aceurl: 'https://form.making.link/public/lib/ace' // The address is the ace file directory
})

Explain

If aceurl not set, we will use https://form.making.link/public/lib/ace as default.

The ace file directory is located under the source code public/lib/ace and can be deployed offline on your own server.

导出 PDF ^1.5.8

需要在项目中单独引入 jspdfhtml2canvas 库,才能使用导出 PDF 的功能。

bash
yarn add jspdf
bash
npm install jspdf --save
js
import { jsPDF } from 'jspdf'
import html2canvas from 'html2canvas'

Vue.use(FormMaking, {
  jsPDF,
  html2canvas
})

在 HTML 中使用

除了上面通过 import 引入,也可以直接使用 script 在 html 中引入

html
<script src="https://unpkg.com/jspdf@latest/dist/jspdf.umd.min.js"></script>
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>