<template>
<div class="slt-item">
<input
id="fileid"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@change="beforeUpload"
type="file"
text="导入"
/>
</div>
</template>
<script>
export default {
name: 'input-file',
methods: {
onChange(e) {
const oFile = e.target.files[0]
const suffix = oFile.name.split('.')[1]
if (suffix.includes('xlsx')) {
console.log('文件格式不对')
}
}
}
}
</script>
<style>
</style>
el-select
<template>
<el-select
v-bind="$attrs"
v-on="$listeners"
>
<el-option
v-for="item in options"
:key="item[labelVal[1]]"
:label="item[labelVal[0]]"
:value="item[labelVal[1]]"
>
<slot></slot>
</el-option>
</el-select>
</template>
<script>
export default {
name: 'select-plus',
props: {
options: {
type: Array,
default: () => []
},
labelVal: {
type: Array,
default: () => ['label', 'value']
}
},
data() {
return {
val: null
}
},
methods: {
}
}
</script>
<style>
</style>