This commit is contained in:
j3d1 2024-05-22 23:18:57 +02:00
parent b4662f00be
commit 275240433e
2 changed files with 5 additions and 2 deletions

View file

@ -28,7 +28,6 @@ export default {
}, },
onchange(event) { onchange(event) {
this.$emit('input', event.target.innerText); this.$emit('input', event.target.innerText);
this.value = event.target.innerText;
} }
} }
}; };

View file

@ -3,7 +3,8 @@
<ul> <ul>
<li v-for="template in messageTemplates" :key="template.id"> <li v-for="template in messageTemplates" :key="template.id">
{{ template.name }}<br> {{ template.name }}<br>
<FormatedText :value="template.message" :format="formatText"/> <FormatedText :value="template.message" :format="formatText"
@input="changeMessageTemplate(template.id, $event)"/>
</li> </li>
</ul> </ul>
<h3 class="text-center">Message Template Variables</h3> <h3 class="text-center">Message Template Variables</h3>
@ -29,6 +30,9 @@ export default {
return value.replace(/{{(.+?)}}/g, (match, key) => { return value.replace(/{{(.+?)}}/g, (match, key) => {
return `<span class="text-primary">{{ ${key} }}</span>`; return `<span class="text-primary">{{ ${key} }}</span>`;
}).replace(/\n/g, '<br>').replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;'); }).replace(/\n/g, '<br>').replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;');
},
changeMessageTemplate(id, message) {
console.log(id, message);
} }
}, },
mounted() { mounted() {