项目需要自定义字段,但是有个样式不太好实现,记录一下。
<template>
<el-dialog title="新建字段" :visible.sync="visible" width="50%" :before-close="handleClose">
<div class="tabs-box">
<div class="tabs-title">
<span class="tabs-title-type">选择字段类型span>
<span class="tabs-title-stats">字段属性span>
div>
<el-tabs :tab-position="'left'" type="card" style="height: calc(100% - 50px);">
<el-tab-pane label="单行文本">el-tab-pane>
<el-tab-pane label="多行文本">多行文本el-tab-pane>
<el-tab-pane label="下拉列表">下拉列表el-tab-pane>
<el-tab-pane label="单选">单选el-tab-pane>
<el-tab-pane label="多选">多选el-tab-pane>
<el-tab-pane label="日期">日期el-tab-pane>
<el-tab-pane label="数字">数字el-tab-pane>
<el-tab-pane label="附件">附件el-tab-pane>
el-tabs>
div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消el-button>
<el-button type="primary" @click="onSubmit">确 定el-button>
span>
el-dialog>
template>
<script>
export default {
props: {
visible: {
type: Boolean
}
},
data() {
return {
}
},
methods: {
// 确认
onSubmit() {
const data = {}
this.$emit('submit', data)
},
// 关闭弹窗
handleClose() {
this.$emit('close')
}
}
}
</script>