summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-06-07 20:24:07 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-06-07 20:24:07 +0900
commitdacc713f99208b6d8784ee4156264127c1ee3246 (patch)
treeb5946ba3382e2180971ebf4fd38f9893ef0f43ad /src
parentMerge branch 'develop' of https://github.com/syuilo/misskey into develop (diff)
downloadmisskey-dacc713f99208b6d8784ee4156264127c1ee3246.tar.gz
misskey-dacc713f99208b6d8784ee4156264127c1ee3246.tar.bz2
misskey-dacc713f99208b6d8784ee4156264127c1ee3246.zip
Fix #5021
Diffstat (limited to 'src')
-rw-r--r--src/client/app/common/views/pages/page/page.vue58
1 files changed, 37 insertions, 21 deletions
diff --git a/src/client/app/common/views/pages/page/page.vue b/src/client/app/common/views/pages/page/page.vue
index 7938d706b9..96a2cfafb7 100644
--- a/src/client/app/common/views/pages/page/page.vue
+++ b/src/client/app/common/views/pages/page/page.vue
@@ -1,5 +1,5 @@
<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>
<div class="title">{{ page.title }}</div>
</header>
@@ -85,30 +85,46 @@ export default Vue.extend({
};
},
+ computed: {
+ path(): string {
+ return this.username + '/' + this.pageName;
+ }
+ },
+
+ watch: {
+ path() {
+ this.fetch();
+ }
+ },
+
created() {
- 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);
- });
- });
+ this.fetch();
},
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() {
return collectPageVars(this.page.content);
},