|
|
|
@ -2,25 +2,25 @@
|
|
|
|
<NuxtLayout name="edit">
|
|
|
|
<NuxtLayout name="edit">
|
|
|
|
<template #content>
|
|
|
|
<template #content>
|
|
|
|
<div class="mb-2 flex w-full">
|
|
|
|
<div class="mb-2 flex w-full">
|
|
|
|
<input type="text" v-model="note.title" placeholder="untitled" @change="submit()" />
|
|
|
|
<el-input
|
|
|
|
</div>
|
|
|
|
v-model="note.title"
|
|
|
|
<div class="sticky top-0 flex w-full justify-between">
|
|
|
|
placeholder="untitled"
|
|
|
|
<div @click="toggleComp('text')" class="w-1/2 bg-lightgray p-2 text-center text-xl"
|
|
|
|
@change="submit()" />
|
|
|
|
:class="{ 'bg-secondary': comp === 'text' }">
|
|
|
|
|
|
|
|
Text
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div @click="toggleComp('md')" class="w-1/2 bg-lightgray p-2 text-center text-xl"
|
|
|
|
|
|
|
|
:class="{ 'bg-secondary': comp === 'md' }">
|
|
|
|
|
|
|
|
Markdown
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="flex h-full w-full flex-col">
|
|
|
|
|
|
|
|
<textarea ref="noteTextArea" v-show="comp === 'text'"
|
|
|
|
|
|
|
|
class="min-h-screen w-full flex-grow resize-none border-none bg-secondary p-4 outline-none placeholder:text-zinc-700 focus:outline-none"
|
|
|
|
|
|
|
|
v-model="input" @change="submit()">
|
|
|
|
|
|
|
|
</textarea>
|
|
|
|
|
|
|
|
<CardMarkdownRenderer v-show="comp === 'md'" :content="note.description" :state="'description'" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<el-tabs type="border-card">
|
|
|
|
|
|
|
|
<el-tab-pane label="Text">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="input"
|
|
|
|
|
|
|
|
:autosize="{ minRows: 40 }"
|
|
|
|
|
|
|
|
type="textarea"
|
|
|
|
|
|
|
|
placeholder="Please input" />
|
|
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
<el-tab-pane label="Markdown">
|
|
|
|
|
|
|
|
<CardMarkdownRenderer
|
|
|
|
|
|
|
|
:content="note.description"
|
|
|
|
|
|
|
|
:state="'description'" />
|
|
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
</el-tabs>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</NuxtLayout>
|
|
|
|
</NuxtLayout>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -98,3 +98,11 @@ watch(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
:deep(.el-tabs__header) {
|
|
|
|
|
|
|
|
position: sticky;
|
|
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
|
|
z-index: 100;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|