Authored by TaoHuang

fix yhood

... ... @@ -5,6 +5,7 @@ import {createStore} from './store';
import 'filters';
import 'directives';
import titleMixin from './mixins/title';
import downloadMixin from './mixins/download';
import pluginCore from './plugins/core';
import lazyload from 'vue-lazyload';
import reportError from 'report-error';
... ... @@ -19,6 +20,7 @@ Vue.use(lazyload, {
});
Vue.use(pluginCore);
Vue.mixin(titleMixin);
Vue.mixin(downloadMixin);
dayjs.locale('zh-cn');
dayjs.extend(relativeTime);
... ...
const serverDownloadMixin = {
methods: {
isDownloadBarHide() {
return true;
}
}
};
const clientDownloadMixin = {
methods: {
isDownloadBarHide() {
return document.getElementById('no-download');
}
}
};
export default process.env.VUE_ENV === 'server' ?
serverDownloadMixin :
clientDownloadMixin;
... ...
<template>
<a class="openapp-btn hover-opacity" href="javascript:;" @click="toDownloadPage">
<a v-if="visible" class="openapp-btn hover-opacity" href="javascript:;" @click="toDownloadPage">
<span class="avatar-block">
<div class="avatar"></div>
</span>
... ... @@ -10,6 +10,16 @@
<script>
export default {
data() {
return {
visible: true
};
},
mounted() {
if (this.isDownloadBarHide()) {
this.visible = false;
}
},
methods: {
toDownloadPage() {
this.$openApp();
... ...
... ... @@ -12,6 +12,11 @@ export default {
};
},
mounted() {
if (this.isDownloadBarHide()) {
this.visible = false;
return;
}
this.getDownloadElem((elem) => {
const newElem = this.handleElem(elem.cloneNode(true));
... ...