SPA with bookmark form, list with category filters, and categorize button. Served via nginx with API reverse proxy. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
701 B
Vue
27 lines
701 B
Vue
<script setup>
|
|
import { ref } from 'vue'
|
|
import { createBookmark } from '../api.js'
|
|
|
|
const emit = defineEmits(['created'])
|
|
const title = ref('')
|
|
const link = ref('')
|
|
|
|
async function submit() {
|
|
if (!title.value.trim() || !link.value.trim()) return
|
|
const bookmark = await createBookmark({
|
|
title: title.value.trim(),
|
|
link: link.value.trim(),
|
|
})
|
|
emit('created', bookmark)
|
|
title.value = ''
|
|
link.value = ''
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<form class="bookmark-form" @submit.prevent="submit">
|
|
<input v-model="title" placeholder="Title" required />
|
|
<input v-model="link" placeholder="https://..." required />
|
|
<button type="submit" class="btn-add">Add</button>
|
|
</form>
|
|
</template>
|