feat: performance optimization.

pull/3445/head
ruibaby 2019-11-23 21:50:55 +08:00
parent 7cbc176dd6
commit c3878afd82
5 changed files with 9 additions and 21 deletions

View File

@ -212,9 +212,6 @@ export default {
default: true default: true
} }
}, },
created() {
this.loadSkeleton()
},
mounted() { mounted() {
this.player = this.$refs.player this.player = this.$refs.player
}, },

View File

@ -30,7 +30,7 @@
:paragraph="{ rows: 18 }" :paragraph="{ rows: 18 }"
> >
<a-col :span="24"> <a-col :span="24">
<a-empty v-if="formattedDatas.length==0"/> <a-empty v-if="formattedDatas.length==0" />
<div <div
v-else v-else
class="attach-item" class="attach-item"
@ -139,14 +139,11 @@ export default {
}) })
} }
}, },
created() {
this.loadSkeleton()
this.loadAttachments()
},
watch: { watch: {
visible: function(newValue, oldValue) { visible: function(newValue, oldValue) {
if (newValue) { if (newValue) {
this.loadSkeleton() this.loadSkeleton()
this.loadAttachments()
} }
} }
}, },

View File

@ -28,7 +28,7 @@
:paragraph="{ rows: 18 }" :paragraph="{ rows: 18 }"
> >
<a-col :span="24"> <a-col :span="24">
<a-empty v-if="attachments.length==0"/> <a-empty v-if="attachments.length==0" />
<div <div
v-else v-else
class="attach-item" class="attach-item"
@ -129,14 +129,11 @@ export default {
uploadHandler: attachmentApi.upload uploadHandler: attachmentApi.upload
} }
}, },
created() {
this.loadSkeleton()
this.loadAttachments()
},
watch: { watch: {
visible: function(newValue, oldValue) { visible: function(newValue, oldValue) {
if (newValue) { if (newValue) {
this.loadSkeleton() this.loadSkeleton()
this.loadAttachments()
} }
} }
}, },

View File

@ -163,9 +163,6 @@ export default {
} }
} }
}, },
created() {
this.loadSkeleton()
},
computed: { computed: {
...mapGetters(['options']) ...mapGetters(['options'])
}, },

View File

@ -31,7 +31,10 @@
<a-input v-model="selectedPost.url" /> <a-input v-model="selectedPost.url" />
</a-form-item> </a-form-item>
<a-form-item label="访问密码:"> <a-form-item label="访问密码:">
<a-input-password v-model="selectedPost.password" autocomplete="new-password"/> <a-input-password
v-model="selectedPost.password"
autocomplete="new-password"
/>
</a-form-item> </a-form-item>
<a-form-item label="发表时间:"> <a-form-item label="发表时间:">
@ -261,10 +264,6 @@ export default {
default: false default: false
} }
}, },
created() {
this.loadSkeleton()
this.loadCategories()
},
watch: { watch: {
post(val) { post(val) {
this.selectedPost = val this.selectedPost = val
@ -287,6 +286,7 @@ export default {
visible: function(newValue, oldValue) { visible: function(newValue, oldValue) {
if (newValue) { if (newValue) {
this.loadSkeleton() this.loadSkeleton()
this.loadCategories()
} }
} }
}, },