Add index file to markdown interface

This commit is contained in:
rijkvanzanten
2020-08-18 16:33:11 -06:00
parent 8124cf6be4
commit 32cae38e36
2 changed files with 31 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
import InterfaceMarkdown from './markdown.vue';
import { defineInterface } from '@/interfaces/define';
export default defineInterface(({ i18n }) => ({
id: 'markdown',
name: i18n.t('markdown'),
icon: 'text_fields',
component: InterfaceMarkdown,
types: ['text'],
options: [
{
field: 'placeholder',
name: i18n.t('placeholder'),
system: {
width: 'half',
interface: 'text-input',
},
},
{
field: 'tabbed',
name: i18n.t('tabbed'),
system: {
width: 'half',
interface: 'toggle',
},
},
],
}));

View File

@@ -27,7 +27,7 @@
<script lang="ts">
import marked from 'marked';
import { defineComponent, PropType, computed, ref } from '@vue/composition-api';
import { defineComponent, computed, ref } from '@vue/composition-api';
export default defineComponent({
props: {
@@ -52,8 +52,8 @@ export default defineComponent({
const currentTab = ref(0);
const html = computed(() => marked(props.value));
const showEdit = computed(() => !props.tabbed || currentTab.value == 0);
const showPreview = computed(() => !props.tabbed || currentTab.value != 0);
const showEdit = computed(() => !props.tabbed || currentTab.value === 0);
const showPreview = computed(() => !props.tabbed || currentTab.value !== 0);
return { html, currentTab, showEdit, showPreview };
},