import { createApp } from "vue";
import Antd from "@hwork/ant-design-vue";
import App from "./App.vue";
import Router from './route/index.js';
import Store from './store/index.js';
import Pear from './component/index.js';
import i18n from './locale/index.js';
import * as antIcons from '@ant-design/icons-vue';
import { Select, Input, Table } from '@hwork/ant-design-vue'
import ATableEllipsisDefault from './component/lib/ATableEllipsisDefault.js'

import "./assets/css/index.less";
import "@hwork/ant-design-vue/dist/reset.css";
import VueCropper from 'vue-cropper'

Select.props.placeholder.default = '请选择'
Input.props.placeholder.default = '请输入'
Table.props.scroll.default = { x: 'max-content', y: 'flex' }
const app = createApp(App)
app.use(i18n)
app.use(Antd)
// 覆盖全局 ATable，使 columns.ellipsis 默认开启
app.component('ATable', ATableEllipsisDefault)
app.use(Pear)
app.use(Store)
app.use(Router)
app.use(VueCropper)
app.mount("#app")

Object.keys(antIcons).forEach(key => {
    app.component(key, antIcons[key])
})

app.config.globalProperties.$antIcons = antIcons

export default app
