mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 19:08:20 +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,
|
sortBy?: string,
|
||||||
sortDesc?: boolean,
|
sortDesc?: boolean,
|
||||||
selection?: number[],
|
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<{
|
const emit = defineEmits<{
|
||||||
(event: 'rowAction', index: number): void,
|
(event: 'rowAction', index: number): void,
|
||||||
|
@ -126,7 +127,7 @@ function dragDropRow() {
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(row, index) in displayData" :key="index"
|
<tr v-for="(row, index) in displayData" :key="index"
|
||||||
draggable="true"
|
:draggable="draggable"
|
||||||
@click="() => rowSelection(index)"
|
@click="() => rowSelection(index)"
|
||||||
@dblclick="() => emit('rowAction', index)"
|
@dblclick="() => emit('rowAction', index)"
|
||||||
@dragstart="() => draggedRow = index"
|
@dragstart="() => draggedRow = index"
|
||||||
|
|
|
@ -32,6 +32,6 @@ onMounted(async() => {
|
||||||
<PageHeader title="DNAT Rules">
|
<PageHeader title="DNAT Rules">
|
||||||
<button @click="loadRules">Load Rules</button>
|
<button @click="loadRules">Load Rules</button>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
<NiceTable :columns="columns" v-model:data="rules"/>
|
<NiceTable :columns="columns" v-model:data="rules" draggable="true"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
|
@ -33,6 +33,6 @@ onMounted(async() => {
|
||||||
<PageHeader title="Forward Rules">
|
<PageHeader title="Forward Rules">
|
||||||
<button @click="loadRules">Load Rules</button>
|
<button @click="loadRules">Load Rules</button>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
<NiceTable :columns="columns" v-model:data="rules"/>
|
<NiceTable :columns="columns" v-model:data="rules" draggable="true"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
|
@ -32,6 +32,6 @@ onMounted(async() => {
|
||||||
<PageHeader title="SNAT Rules">
|
<PageHeader title="SNAT Rules">
|
||||||
<button @click="loadRules">Load Rules</button>
|
<button @click="loadRules">Load Rules</button>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
<NiceTable :columns="columns" v-model:data="rules"/>
|
<NiceTable :columns="columns" v-model:data="rules" draggable="true"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
Loading…
Add table
Reference in a new issue