]> git.ipfire.org Git - thirdparty/google/fonts.git/commitdiff
Add missing file
authorMarc Foley <m.foley.88@gmail.com>
Thu, 17 Jul 2025 08:49:34 +0000 (09:49 +0100)
committerMarc Foley <m.foley.88@gmail.com>
Thu, 17 Jul 2025 08:49:34 +0000 (09:49 +0100)
tagger2/AddCategory.js [new file with mode: 0644]

diff --git a/tagger2/AddCategory.js b/tagger2/AddCategory.js
new file mode 100644 (file)
index 0000000..933d9c4
--- /dev/null
@@ -0,0 +1,24 @@
+export default {
+    data: function() {
+        return {
+            category: "", // Input for new category
+        }
+    },
+    methods: {
+        addCategory() {
+            if (this.category.trim() === "") {
+                alert("Category name cannot be empty.");
+                return;
+            }
+            this.$emit('category-added', this.category.trim());
+            this.category = ""; // Reset the input field after adding
+        }
+    },
+    template: `
+        <div>
+            <h3>Add new category</h3>
+            <input type="text" v-model="category" placeholder="Category" />
+            <button @click="addCategory">Add</button>
+        </div>
+    `
+}
\ No newline at end of file