This commit is contained in:
张亚强
2020-06-25 12:12:31 +08:00
parent 67402224f2
commit b1d67811bd
14 changed files with 594 additions and 76 deletions

25
packages/index.js Normal file
View File

@@ -0,0 +1,25 @@
import JsonSchemaEditor from './json-schema-editor/index'
const components = [
JsonSchemaEditor
]
// 定义 install 方法
const install = function (Vue) {
if (install.installed) return
install.installed = true
// 遍历并注册全局组件
components.map(component => {
Vue.component(component.name, component)
})
}
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue)
}
export default {
// 导出的对象必须具备一个 install 方法
install,
// 组件列表
...components
}

View File

@@ -0,0 +1,7 @@
import JsonSchemaEditor from './main.vue'
JsonSchemaEditor.install = function (Vue) {
Vue.component(JsonSchemaEditor.name, JsonSchemaEditor)
}
export default JsonSchemaEditor

View File

@@ -0,0 +1,19 @@
<template>
<div class="json-schema-editor">
json-schema-editor
<a-input/>
<a-button type="primary">测试按钮</a-button>
<a-icon type="step-backward" />
</div>
</template>
<script>
import { Button, Input, Icon } from 'ant-design-vue'
export default {
name: 'JsonSchemaEditor',
components: {
AButton: Button,
AInput: Input,
AIcon:Icon
}
}
</script>

View File