2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-07 10:37:14 +08:00
Files
panel/web/src/views/file/EditModal.vue
2024-11-01 23:07:51 +08:00

36 lines
845 B
Vue

<script setup lang="ts">
const show = defineModel<boolean>('show', { type: Boolean, required: true })
const file = defineModel<string>('file', { type: String, required: true })
const editor = ref<any>(null)
const handleRefresh = () => {
editor.value.get()
}
const handleSave = () => {
editor.value.save()
}
</script>
<template>
<n-modal
v-model:show="show"
preset="card"
:title="'编辑 - ' + file"
style="width: 60vw"
size="huge"
:bordered="false"
:segmented="false"
>
<template #header-extra>
<n-flex>
<n-button @click="handleRefresh"> 刷新 </n-button>
<n-button type="primary" @click="handleSave"> 保存 </n-button>
</n-flex>
</template>
<code-editor ref="editor" :path="file" :read-only="false" />
</n-modal>
</template>
<style scoped lang="scss"></style>