chore: remove unused code
This commit is contained in:
@ -92,18 +92,6 @@ async function deleteDocument(document: any) {
|
|||||||
rpc.deleteDocument(props.collection, document._id)
|
rpc.deleteDocument(props.collection, document._id)
|
||||||
documents.value = await rpc.listDocuments(props.collection)
|
documents.value = await rpc.listDocuments(props.collection)
|
||||||
}
|
}
|
||||||
|
|
||||||
const fieldRefs = ref<any>([])
|
|
||||||
function handleClickOutside(event: any) {
|
|
||||||
if (editing.value && selectedDocument.value) {
|
|
||||||
const isClickOutside = fieldRefs.value.every((ref: any) => !ref.contains(event.target))
|
|
||||||
if (isClickOutside) {
|
|
||||||
editing.value = false
|
|
||||||
selectedDocument.value = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// useEventListener('click', handleClickOutside)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -133,7 +121,7 @@ function handleClickOutside(event: any) {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<!-- hover-bg-green hover-bg-opacity-5 hover-text-green cursor-pointer -->
|
<!-- hover-bg-green hover-bg-opacity-5 hover-text-green cursor-pointer -->
|
||||||
<tr v-for="document in filtered" :key="document._id" :class="{ isEditing: editing && selectedDocument._id === document._id }">
|
<tr v-for="document in filtered" :key="document._id" :class="{ isEditing: editing && selectedDocument._id === document._id }">
|
||||||
<td v-for="field of fields" :key="field" ref="fieldRefs" @dblclick="editDocument(document)">
|
<td v-for="field of fields" :key="field" @dblclick="editDocument(document)">
|
||||||
<template v-if="editing && selectedDocument._id === document._id">
|
<template v-if="editing && selectedDocument._id === document._id">
|
||||||
<input v-model="selectedDocument[field]" :disabled="field === '_id'">
|
<input v-model="selectedDocument[field]" :disabled="field === '_id'">
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -1,28 +1,6 @@
|
|||||||
import { resolve } from 'node:path'
|
|
||||||
import { defineNuxtModule } from '@nuxt/kit'
|
|
||||||
import { startSubprocess } from '@nuxt/devtools-kit'
|
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
modules: [
|
modules: [
|
||||||
'@nuxt/devtools',
|
'@nuxt/devtools',
|
||||||
'../src/module',
|
'../src/module',
|
||||||
defineNuxtModule({
|
|
||||||
setup(_, nuxt) {
|
|
||||||
if (!nuxt.options.dev)
|
|
||||||
return
|
|
||||||
|
|
||||||
const process = startSubprocess(
|
|
||||||
{
|
|
||||||
command: 'npx',
|
|
||||||
args: ['nuxi', 'dev', '--port', '3300'],
|
|
||||||
cwd: resolve(__dirname, '../client'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'nuxt-mongoose:client',
|
|
||||||
name: 'Nuxt Mongoose Client Dev',
|
|
||||||
},
|
|
||||||
)
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user