1 回答

TA貢獻1871條經驗 獲得超8個贊
您只需要在表格標簽中添加模板,就像您對刪除圖標所做的那樣,您需要確保它的v-slot名稱與您想要將文本字段放在其下的標題一樣。
<v-layout align-start>
<v-flex>
<v-container grid-list-sm class="pa-4 white">
<v-layout row wrap>
<v-flex xs12 sm8 md8 lg8 xl8>
<v-text-field v-model="code" label="Barcode" @keyup.enter="searchBarcode()">
</v-text-field>
</v-flex>
<v-flex xs12 sm12 md12 lg12 xl12>
<v-data-table
:headers="headerDetails"
:items="detailsWithSubTotal"
hide-default-footer
class="elevation-1"
>
<template v-slot:item.delete="{ item }">
<v-icon small class="ml-3" @click="deleteDetail(details, item)">
delete
</v-icon>
</template>
<template v-slot:item.quantity="{ item }">
<v-text-field v-model="item.quantity">
</v-text-field>
</template>
<template v-slot:no-data>
<h3>There are no current products added on details.</h3>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-container>
</v-flex>
</v-layout>
代碼的結果如下所示:screenshot
添加回答
舉報