0.2.8 • Published 1 year ago

leivii-editor v0.2.8

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Leivii Editor

Geek version Repo link Gitlab link

logo

使用文档

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

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.3

1 year ago

0.2.2

2 years ago

0.2.5

1 year ago

0.2.4

1 year ago

0.1.32

2 years ago

0.1.33

2 years ago

0.1.30

2 years ago

0.1.31

2 years ago

0.1.27

2 years ago

0.1.28

2 years ago

0.1.29

2 years ago

0.1.26

2 years ago

0.1.23

2 years ago

0.1.24

2 years ago

0.1.25

2 years ago

0.1.21

2 years ago

0.1.22

2 years ago

0.1.20

2 years ago

0.1.19

2 years ago

0.1.18

2 years ago

0.1.17

2 years ago

0.1.16

2 years ago

0.1.15

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago