variant-form3-vite/install-render.js
2022-01-16 15:18:25 +08:00

44 lines
993 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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组件
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)
app.component(VFormRender.name, VFormRender)
}
const components = [
VFormRender
]
const install = (app) => {
installI18n(app)
loadExtension(app)
app.use(ContainerItems)
app.component('svg-icon', SvgIcon)
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
}