mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-15 22:23:08 +02:00
63df2c851e
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
56 lines
1,007 B
Vue
56 lines
1,007 B
Vue
<template>
|
|
<div v-if="hpml" class="iroscrza" :class="{ center: page.alignCenter, serif: page.font === 'serif' }">
|
|
<XBlock v-for="child in page.content" :key="child.id" :block="child" :hpml="hpml" :h="2"/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent, onMounted, nextTick, PropType } from 'vue';
|
|
import XBlock from './page.block.vue';
|
|
import { Hpml } from '@/scripts/hpml/evaluator';
|
|
import { url } from '@/config';
|
|
import { $i } from '@/account';
|
|
|
|
export default defineComponent({
|
|
components: {
|
|
XBlock,
|
|
},
|
|
props: {
|
|
page: {
|
|
type: Object as PropType<Record<string, any>>,
|
|
required: true,
|
|
},
|
|
},
|
|
setup(props, ctx) {
|
|
const hpml = new Hpml(props.page, {
|
|
randomSeed: Math.random(),
|
|
visitor: $i,
|
|
url: url,
|
|
});
|
|
|
|
onMounted(() => {
|
|
nextTick(() => {
|
|
hpml.eval();
|
|
});
|
|
});
|
|
|
|
return {
|
|
hpml,
|
|
};
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.iroscrza {
|
|
&.serif {
|
|
> div {
|
|
font-family: serif;
|
|
}
|
|
}
|
|
|
|
&.center {
|
|
text-align: center;
|
|
}
|
|
}
|
|
</style>
|