Add v-md directive (#6835)

* Use stricter Vue eslint setting

* Implement v-md directive

Replaces old uses of v-html + md util

* Fix typo
This commit is contained in:
Rijk van Zanten
2021-07-15 20:01:30 +02:00
committed by GitHub
parent 5f7dce54e2
commit d38681c2ee
27 changed files with 52 additions and 87 deletions

View File

@@ -1,4 +1,5 @@
<template>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="md" :class="pageClass" @click="onClick" v-html="html" />
</template>

View File

@@ -7,7 +7,7 @@
</template>
<template #title>
<h1 class="type-title" v-html="title"></h1>
<h1 class="type-title">{{ title }}</h1>
</template>
<template #navigation>
@@ -20,7 +20,7 @@
<template #sidebar>
<sidebar-detail icon="info_outline" :title="t('information')" close>
<div class="page-description" v-html="md(t('page_help_docs_global'))" />
<div v-md="t('page_help_docs_global')" class="page-description" />
</sidebar-detail>
</template>
</private-view>
@@ -31,7 +31,6 @@ import { useI18n } from 'vue-i18n';
import { defineComponent, defineAsyncComponent, ref, computed, watch } from 'vue';
import { useRoute, RouteLocation } from 'vue-router';
import DocsNavigation from '../components/navigation.vue';
import { md } from '@/utils/md';
const Markdown = defineAsyncComponent(() => import('../components/markdown.vue'));
@@ -84,7 +83,7 @@ export default defineComponent({
{ immediate: true, flush: 'post' }
);
return { t, route, markdown, title, markdownWithoutTitle, md };
return { t, route, markdown, title, markdownWithoutTitle };
},
});
</script>