variant-form3-vite/install-render.js

43 lines
944 B
JavaScript
Raw Normal View History

2022-01-01 19:15:45 +08:00
import axios from 'axios'
import VFormRender from '@/components/form-render/index.vue'
import ContainerItems from '@/components/form-render/container-item/index'
import SvgIcon from '@/components/svg-icon' //svg组件
2022-01-01 19:15:45 +08:00
import { installI18n } from '@/utils/i18n'
import { loadExtension } from '@/extension/extension-loader'
VFormRender.install = function (app) {
installI18n(app)
loadExtension(app)
app.use(ContainerItems)
app.component('svg-icon', SvgIcon)
2022-01-01 19:15:45 +08:00
app.component(VFormRender.name, VFormRender)
}
const components = [
VFormRender
]
const install = (app) => {
installI18n(app)
loadExtension(app)
app.use(ContainerItems)
app.component('svg-icon', SvgIcon)
2022-01-01 19:15:45 +08:00
components.forEach(component => {
app.component(component.name, component)
})
}
if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时赋值axios */
window.axios = axios
}
2022-01-01 19:15:45 +08:00
export default {
install,
VFormRender
}