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 { uploadFiles } from './api'
Vue.use(VueElementUiPlus, {
    size: 'small',
    pagination: { pageSizes: [10, 20, 50, 100] },
    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)
        // },
        // onSuccess(response) {
        //     console.log('response  ---- ', response)
        //     return '/files/' + response[0]
        // }
    }
})

// Vue.use(Table)

sessionStorage.setItem("token", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsaWNlbnNlIjoic28tZmFzdCIsInVzZXJfbmFtZSI6InN5c19hZG1pbiIsInNjb3BlIjpbInJlYWQiLCJ3cml0ZSJdLCJleHAiOjE2NzczNjQyOTYsInVzZXJOYW1lIjoic3lzX2FkbWluIiwidXNlcklkIjozNywiYXV0aG9yaXRpZXMiOlsiYWRtaW4iLCJkZXZpY2VNYW5hZ2VyIiwiSFJBIl0sImp0aSI6ImJhYzhkNmQ1LWIwNWItNGIwYy05NjI2LWQyZDdkYTJjODdkZCIsIm9yZ0lkIjoxLCJjbGllbnRfaWQiOiJ3ZWIifQ.2B3Av1Jl6njM6FJZcAlmg6evi4BY_OxfYGzX2cSeAlM");

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

