This commit is contained in:
タービン
2023-03-15 10:44:24 +09:00
committed by GitHub
parent c05c504c86
commit 42833cd921
3 changed files with 34 additions and 3 deletions

View File

@@ -75,6 +75,8 @@ import MkPagination from '@/components/MkPagination.vue';
import MkPagePreview from '@/components/MkPagePreview.vue';
import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata';
import { pageViewInterruptors } from '@/store';
import { deepClone } from '@/scripts/clone';
const props = defineProps<{
pageName: string;
@@ -97,8 +99,17 @@ function fetchPage() {
os.api('pages/show', {
name: props.pageName,
username: props.username,
}).then(_page => {
}).then(async _page => {
page = _page;
// plugin
if (pageViewInterruptors.length > 0) {
let result = deepClone(_page);
for (const interruptor of pageViewInterruptors) {
result = await interruptor.handler(result);
}
page = result;
}
}).catch(err => {
error = err;
});