forked from FoundKeyGang/FoundKey
Fix #5021
This commit is contained in:
parent
a1f794ee05
commit
dacc713f99
1 changed files with 37 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-if="page" class="iroscrza" :class="{ shadow: $store.state.device.useShadow, round: $store.state.device.roundedCorners, center: page.alignCenter }" :style="{ fontFamily: page.font }">
|
<div v-if="page" class="iroscrza" :class="{ shadow: $store.state.device.useShadow, round: $store.state.device.roundedCorners, center: page.alignCenter }" :style="{ fontFamily: page.font }" :key="path">
|
||||||
<header>
|
<header>
|
||||||
<div class="title">{{ page.title }}</div>
|
<div class="title">{{ page.title }}</div>
|
||||||
</header>
|
</header>
|
||||||
|
@ -85,30 +85,46 @@ export default Vue.extend({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
path(): string {
|
||||||
|
return this.username + '/' + this.pageName;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
path() {
|
||||||
|
this.fetch();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.$root.api('pages/show', {
|
this.fetch();
|
||||||
name: this.pageName,
|
|
||||||
username: this.username,
|
|
||||||
}).then(page => {
|
|
||||||
this.page = page;
|
|
||||||
this.$emit('init', {
|
|
||||||
title: this.page.title,
|
|
||||||
icon: faStickyNote
|
|
||||||
});
|
|
||||||
const pageVars = this.getPageVars();
|
|
||||||
this.script = new Script(new ASEvaluator(this.page.variables, pageVars, {
|
|
||||||
randomSeed: Math.random(),
|
|
||||||
user: page.user,
|
|
||||||
visitor: this.$store.state.i,
|
|
||||||
page: page,
|
|
||||||
url: url
|
|
||||||
}), e => {
|
|
||||||
console.dir(e);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
fetch() {
|
||||||
|
this.$root.api('pages/show', {
|
||||||
|
name: this.pageName,
|
||||||
|
username: this.username,
|
||||||
|
}).then(page => {
|
||||||
|
this.page = page;
|
||||||
|
this.$emit('init', {
|
||||||
|
title: this.page.title,
|
||||||
|
icon: faStickyNote
|
||||||
|
});
|
||||||
|
const pageVars = this.getPageVars();
|
||||||
|
this.script = new Script(new ASEvaluator(this.page.variables, pageVars, {
|
||||||
|
randomSeed: Math.random(),
|
||||||
|
user: page.user,
|
||||||
|
visitor: this.$store.state.i,
|
||||||
|
page: page,
|
||||||
|
url: url
|
||||||
|
}), e => {
|
||||||
|
console.dir(e);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
getPageVars() {
|
getPageVars() {
|
||||||
return collectPageVars(this.page.content);
|
return collectPageVars(this.page.content);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue