vxe-table表格自定义表头(必填加*)

<vxe-table
          ref="table"
          :show-header-overflow="true"
          :show-overflow="true"
          :data="chooseAttributes"
          border
          :header-cell-style="{ background: '#f2f5ff' }"
          :sortConfig="{ trigger: 'cell' }"
          stripe
          v-loading="loading"
          max-height="396px"
          :row-config="{ isHover: true }"
        >
          <template slot="empty">
            <ele-empty />
          </template>
          <vxe-column
            v-for="(item, index) in columns1"
            :minWidth="item.minWidth"
            :visible="item.visible"
            :resizable="true"
            :key="index"
            :title="item.label"
            :field="item.prop"
            :slots="item.slots"
            :sortable="item.sortable"
            :fixed="item.fixed"
          >
          </vxe-column>
          <vxe-column
            :title="$t('info.newvalue')"
            field="newValues"
            minWidth="140px"
          >
            <template #header>
              {{ $t('info.newvalue') }} <span class="star">*</span>
            </template>
            <template #default="{ row }">
              <template v-if="row.inputTypeId == 3">
                <el-select
                  v-model="row.newValues"
                  :placeholder="$t('info.pleaseSelect')"
                  class="ele-fluid sss"
                  style="width: 380px"
                  filterable
                >
                  <el-option
                    v-for="item in row.optionalList"
                    :key="item.id"
                    :label="item.desc"
                    :value="item.id"
                  />
                </el-select>
              </template>
              <template v-else>
                <el-input
                  v-model="row.newValues"
                  :placeholder="$t('info.pleaseInput')"
                  clearable
                />
              </template>
            </template>
          </vxe-column>
        </vxe-table>

  

posted @ 2024-12-26 11:07  Ao_min  阅读(1015)  评论(0)    收藏  举报