2019-04-29 09:11:57 +09:00
|
|
|
<template>
|
2021-11-19 19:36:12 +09:00
|
|
|
<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"/>
|
2019-04-29 09:11:57 +09:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-01-30 10:59:05 +09:00
|
|
|
import { defineComponent, onMounted, nextTick, onUnmounted, PropType } from 'vue';
|
2019-04-29 09:11:57 +09:00
|
|
|
import XBlock from './page.block.vue';
|
2021-11-12 02:02:25 +09:00
|
|
|
import { Hpml } from '@/scripts/hpml/evaluator';
|
|
|
|
import { url } from '@/config';
|
|
|
|
import { $i } from '@/account';
|
|
|
|
import { defaultStore } from '@/store';
|
2019-04-29 09:11:57 +09:00
|
|
|
|
2020-10-17 20:12:00 +09:00
|
|
|
export default defineComponent({
|
2019-04-29 09:11:57 +09:00
|
|
|
components: {
|
2022-12-22 16:01:59 +09:00
|
|
|
XBlock,
|
2019-04-29 09:11:57 +09:00
|
|
|
},
|
|
|
|
props: {
|
2019-07-07 06:56:13 +09:00
|
|
|
page: {
|
2021-01-30 10:59:05 +09:00
|
|
|
type: Object as PropType<Record<string, any>>,
|
2022-12-22 16:01:59 +09:00
|
|
|
required: true,
|
2019-04-29 09:11:57 +09:00
|
|
|
},
|
|
|
|
},
|
2021-01-30 10:59:05 +09:00
|
|
|
setup(props, ctx) {
|
|
|
|
const hpml = new Hpml(props.page, {
|
2019-07-07 06:56:13 +09:00
|
|
|
randomSeed: Math.random(),
|
2021-01-30 10:59:05 +09:00
|
|
|
visitor: $i,
|
2020-04-13 23:46:53 +09:00
|
|
|
url: url,
|
2019-07-07 06:56:13 +09:00
|
|
|
});
|
2019-04-29 09:11:57 +09:00
|
|
|
|
2021-01-30 10:59:05 +09:00
|
|
|
onMounted(() => {
|
|
|
|
nextTick(() => {
|
2023-01-03 15:51:49 +09:00
|
|
|
hpml.eval();
|
2021-01-30 10:59:05 +09:00
|
|
|
});
|
2020-04-16 00:39:21 +09:00
|
|
|
});
|
|
|
|
|
2021-01-30 10:59:05 +09:00
|
|
|
return {
|
|
|
|
hpml,
|
|
|
|
};
|
2020-04-13 23:46:53 +09:00
|
|
|
},
|
2019-04-29 09:11:57 +09:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2022-12-27 18:29:39 +09:00
|
|
|
<style lang="scss" scoped>
|
2020-01-30 04:37:25 +09:00
|
|
|
.iroscrza {
|
|
|
|
&.serif {
|
|
|
|
> div {
|
|
|
|
font-family: serif;
|
|
|
|
}
|
|
|
|
}
|
2019-04-29 09:11:57 +09:00
|
|
|
|
2020-01-30 04:37:25 +09:00
|
|
|
&.center {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
}
|
2019-04-29 09:11:57 +09:00
|
|
|
</style>
|