0.2.8 • Published 2 years ago
leivii-editor v0.2.8
Leivii Editor
使用文档
Leivii 低代码平台的使用文档,请移步 leivii.github.io。
安装
$ vue add leivii-editor
Example
注册组件
import VueI18n from 'vue-i18n'
import LeiviiEditor from 'leivii-editor'
import axios from 'your/path/to/axios'
Vue.use(VueI18n)
const i18n = new VueI18n({
locale: 'cn',
silentTranslationWarn: true,
messages: {
'cn': JSON.parse(localStorage.getItem('Lang_zh_cn'))
}
})
Vue.use(LeiviiEditor, {
store,
i18n: (...args) => i18n.t(...args),
fetch: { axios }
})
使用组件
<leivii-editor v-model="$store.state.data" @change="handleSave">
<div slot="title">Leivii Editor</div>
<template slot="operations">
<div class="operation" @click="handleCreate">
<geek-icon icon-class="create" class="icon" />
</div>
</template>
</leivii-editor>
集成打印插件
// main.js
import { Leivii } from 'leivii-editor'
import { Print, checkPrint } from 'geek-print-config'
Leivii.API.registPlugin('print', {
@Leivii.API.doc('获取打印机列表')
getPrinterList() {
return new Promise(resolve => {
checkPrint.getCLodop().then(_ => {
let PRINTER_COUNT = LODOP.GET_PRINTER_COUNT()
let printerList = []
for (let i = 0; i < PRINTER_COUNT; i++) {
let pitName = LODOP.GET_PRINTER_NAME(i)
printerList.push({ label: pitName, value: i.toString() })
}
resolve(printerList)
})
})
},
@Leivii.API.doc('打印', { label: '模板列表', type: Array }, { label: '打印参数', type: Object, clazz: 'ParamPicker' })
print(tempate, params) {
return new Promise(resolve => {
Print(tempate, params).finally(data => {
console.log("打印完毕")
resolve(data)
})
})
}
}, '打印')
0.2.8
2 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.2.7
2 years ago
0.2.6
2 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.2.5
2 years ago
0.2.4
3 years ago
0.1.32
3 years ago
0.1.33
3 years ago
0.1.30
3 years ago
0.1.31
3 years ago
0.1.27
3 years ago
0.1.28
3 years ago
0.1.29
3 years ago
0.1.26
3 years ago
0.1.23
3 years ago
0.1.24
3 years ago
0.1.25
3 years ago
0.1.21
3 years ago
0.1.22
3 years ago
0.1.20
3 years ago
0.1.19
3 years ago
0.1.18
3 years ago
0.1.17
3 years ago
0.1.16
3 years ago
0.1.15
3 years ago
0.1.14
3 years ago
0.1.13
3 years ago
0.1.12
3 years ago
0.1.11
3 years ago
0.1.10
3 years ago
0.1.9
4 years ago
0.1.8
4 years ago
0.1.7
4 years ago
0.1.6
4 years ago
0.1.5
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago
0.0.4
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago