stash
This commit is contained in:
parent
90da7b5602
commit
b3ff77a1fa
2 changed files with 35 additions and 1 deletions
32
web/src/components/inputs/FormatedText.vue
Normal file
32
web/src/components/inputs/FormatedText.vue
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<template>
|
||||||
|
<div contenteditable>
|
||||||
|
<pre>{{ value }}</pre>
|
||||||
|
<span v-html="rawhtml(value)"></span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'FormatedText',
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
format: {
|
||||||
|
type: Function,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
emits: ['input'],
|
||||||
|
methods: {
|
||||||
|
rawhtml(value) {
|
||||||
|
if (typeof format === 'function') {
|
||||||
|
return format(value);
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -4,6 +4,7 @@
|
||||||
<li v-for="template in messageTemplates" :key="template.id">
|
<li v-for="template in messageTemplates" :key="template.id">
|
||||||
{{ template.name }}<br>
|
{{ template.name }}<br>
|
||||||
<pre>{{ template.message }}</pre>
|
<pre>{{ template.message }}</pre>
|
||||||
|
<FormatedText :value="template.message"/>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3 class="text-center">Message Template Variables</h3>
|
<h3 class="text-center">Message Template Variables</h3>
|
||||||
|
@ -17,10 +18,11 @@
|
||||||
<script>
|
<script>
|
||||||
import {mapActions, mapState} from 'vuex';
|
import {mapActions, mapState} from 'vuex';
|
||||||
import Table from '@/components/Table';
|
import Table from '@/components/Table';
|
||||||
|
import FormatedText from "@/components/inputs/FormatedText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Settings',
|
name: 'Settings',
|
||||||
components: {Table},
|
components: {FormatedText, Table},
|
||||||
computed: mapState(['messageTemplates', 'messageTemplateVariables']),
|
computed: mapState(['messageTemplates', 'messageTemplateVariables']),
|
||||||
methods: mapActions(['fetchMessageTemplates', 'fetchMessageTemplateVariables']),
|
methods: mapActions(['fetchMessageTemplates', 'fetchMessageTemplateVariables']),
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
Loading…
Reference in a new issue