mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 02:48:21 +00:00
Make draggable a prop
This commit is contained in:
parent
04a11626f5
commit
8d957a53e2
4 changed files with 6 additions and 5 deletions
|
@ -16,8 +16,9 @@ const props = defineModel<{
|
|||
sortBy?: string,
|
||||
sortDesc?: boolean,
|
||||
selection?: number[],
|
||||
draggable?: boolean,
|
||||
}>();
|
||||
let { columns, data, sort, sortSelf, sortBy, sortDesc, selection } = $(props);
|
||||
let { columns, data, sort, sortSelf, sortBy, sortDesc, selection, draggable } = $(props);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: 'rowAction', index: number): void,
|
||||
|
@ -126,7 +127,7 @@ function dragDropRow() {
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(row, index) in displayData" :key="index"
|
||||
draggable="true"
|
||||
:draggable="draggable"
|
||||
@click="() => rowSelection(index)"
|
||||
@dblclick="() => emit('rowAction', index)"
|
||||
@dragstart="() => draggedRow = index"
|
||||
|
|
|
@ -32,6 +32,6 @@ onMounted(async() => {
|
|||
<PageHeader title="DNAT Rules">
|
||||
<button @click="loadRules">Load Rules</button>
|
||||
</PageHeader>
|
||||
<NiceTable :columns="columns" v-model:data="rules"/>
|
||||
<NiceTable :columns="columns" v-model:data="rules" draggable="true"/>
|
||||
</div>
|
||||
</template>
|
|
@ -33,6 +33,6 @@ onMounted(async() => {
|
|||
<PageHeader title="Forward Rules">
|
||||
<button @click="loadRules">Load Rules</button>
|
||||
</PageHeader>
|
||||
<NiceTable :columns="columns" v-model:data="rules"/>
|
||||
<NiceTable :columns="columns" v-model:data="rules" draggable="true"/>
|
||||
</div>
|
||||
</template>
|
|
@ -32,6 +32,6 @@ onMounted(async() => {
|
|||
<PageHeader title="SNAT Rules">
|
||||
<button @click="loadRules">Load Rules</button>
|
||||
</PageHeader>
|
||||
<NiceTable :columns="columns" v-model:data="rules"/>
|
||||
<NiceTable :columns="columns" v-model:data="rules" draggable="true"/>
|
||||
</div>
|
||||
</template>
|
Loading…
Add table
Reference in a new issue