From 3f962345f7d5ad103d8c61a1a1aa2ff494ce6f99 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 10 Feb 2024 10:08:32 +0100 Subject: [PATCH] placeholder working --- vue/src/components/MarkdownEditorComponent.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vue/src/components/MarkdownEditorComponent.vue b/vue/src/components/MarkdownEditorComponent.vue index 60dba94a..7ca78191 100644 --- a/vue/src/components/MarkdownEditorComponent.vue +++ b/vue/src/components/MarkdownEditorComponent.vue @@ -18,15 +18,17 @@ import {defaultKeymap} from "@codemirror/commands" import {markdown} from "@codemirror/lang-markdown" import {autocompletion} from "@codemirror/autocomplete" -class PlaceholderWidget extends WidgetType { //TODO this is not working for some javascript magic reason +class PlaceholderWidget extends WidgetType { name = undefined + constructor(name) { - console.log(name) + console.log('name:', name) super() + this.name = name } eq(other) { - return this.name == other.name + return this.name === other.name } toDOM() { @@ -37,7 +39,7 @@ class PlaceholderWidget extends WidgetType { //TODO this is not working for some padding: 0 3px; background: lightblue;` - elt.textContent = "Food" + elt.textContent = this.name return elt } @@ -98,6 +100,7 @@ export default { {label: "Mehl", type: "text", apply: "{{ ingredients[1] }}", detail: "template"}, {label: "Butter", type: "text", apply: "{{ ingredients[2] }}", detail: "template"}, {label: "Salz", type: "text", apply: "{{ ingredients[3] }}", detail: "template"}, + {label: "Scale", type: "text", apply: "{{ scale(100) }}", detail: "simple scalable number"}, ] } }