40 lines
861 B
JavaScript
40 lines
861 B
JavaScript
|
import axios from 'axios'
|
|||
|
|
|||
|
import VFormRender from '@/components/form-render/index.vue'
|
|||
|
import ContainerItems from '@/components/form-render/container-item/index'
|
|||
|
|
|||
|
import { installI18n } from '@/utils/i18n'
|
|||
|
import { loadExtension } from '@/extension/extension-loader'
|
|||
|
|
|||
|
VFormRender.install = function (app) {
|
|||
|
installI18n(app)
|
|||
|
loadExtension(app)
|
|||
|
|
|||
|
app.use(ContainerItems)
|
|||
|
app.component(VFormRender.name, VFormRender)
|
|||
|
}
|
|||
|
|
|||
|
const components = [
|
|||
|
VFormRender
|
|||
|
]
|
|||
|
|
|||
|
const install = (app) => {
|
|||
|
installI18n(app)
|
|||
|
loadExtension(app)
|
|||
|
|
|||
|
app.use(ContainerItems)
|
|||
|
components.forEach(component => {
|
|||
|
app.component(component.name, component)
|
|||
|
})
|
|||
|
}
|
|||
|
|
|||
|
// if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时主动调用install方法!! */
|
|||
|
// window.axios = axios
|
|||
|
// install(window.Vue);
|
|||
|
// }
|
|||
|
|
|||
|
export default {
|
|||
|
install,
|
|||
|
VFormRender
|
|||
|
}
|