import Vue from 'vue'
import App from './App'
// import ElementUI from 'element-ui'
import VueElementUiPlus from '../src/index'
// import VueElementUiPlus from '../lib/index'
// import Table from '../lib/table'
import '../theme-chalk/index.scss'
import './icons/index'
import { uploadFiles } from './api'


Vue.use(VueElementUiPlus, {
    size: 'small',
    pagination: { pageSizes: [10, 20, 50, 100] },
    button: {
        isProxy: true,
        proxyList: [
            '删除',
        ]
    },
    form: {
        placeholder: true,
        position: true
    },
    select: {
        getOptions() {
            return [
                { label: 'a', id: '1' },
                { label: 'b', id: '2' },
                { label: 'c', id: '3' },
                { label: 'd', id: '4' },
            ]
        }
    },
    table: {
        stripe: true
    },
    tableColumn: {
        showOverflowTooltip: true
    },
    drawer: {
        footer: false,
        showCancelButton: true,
        showConfirmButton: true,
    },
    upload: {
        name: 'files',
        // action: ''
        // autoUpload: false,
        httpRequest(options) {
            let formData = new FormData()
            formData.append(this.name, options.file)
            if (this.data) {
                this.data.forEach(key => {
                    formData.append(key, this.data[key])
                })
            }
            return uploadFiles(formData, options.onProgress)
        }
    }
})

// Vue.use(Table)
sessionStorage.setItem("token", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsaWNlbnNlIjoic28tZmFzdCIsInVzZXJfbmFtZSI6InN5c19hZG1pbiIsInNjb3BlIjpbInJlYWQiLCJ3cml0ZSJdLCJleHAiOjE2Nzc0MjQ5MTAsInVzZXJOYW1lIjoic3lzX2FkbWluIiwidXNlcklkIjozNywiYXV0aG9yaXRpZXMiOlsiYWRtaW4iLCJkZXZpY2VNYW5hZ2VyIiwiSFJBIl0sImp0aSI6IjA5ZjViYTIxLWI0M2YtNGIzOC05NmE4LWUwZGU3ZmUxZDM3YyIsIm9yZ0lkIjoxLCJjbGllbnRfaWQiOiJ3ZWIifQ.0PUTK37dX8XN1rHMmbBQD5souqyBc4njIUFzHPly2cc");

new Vue({
    render: h => h(App)
}).$mount('#app')

