mirror of
https://github.com/directus/directus.git
synced 2026-01-27 07:08:17 -05:00
Add index file to markdown interface
This commit is contained in:
@@ -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',
|
||||
},
|
||||
},
|
||||
],
|
||||
}));
|
||||
|
||||
@@ -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 };
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user