Authored by yyq

fix load lodash

... ... @@ -9,7 +9,6 @@
</template>
<script>
import {pxToRem} from '../../../utils/helpers.js';
import {forEach, get} from 'lodash';
import {createNamespacedHelpers} from 'vuex';
const {mapActions} = createNamespacedHelpers('user');
... ... @@ -102,10 +101,10 @@
return this._icon.default;
},
iconStyle() {
return `font-size: ${pxToRem(this.option.iconFontSize)};`;
return `font-size: ${this.pxToRem(this.option.iconFontSize)};`;
},
textStyle() {
let style = `font-size: ${pxToRem(this.option.textFontSize)};`;
let style = `font-size: ${this.pxToRem(this.option.textFontSize)};`;
let textAlign = this.option.textAlign;
... ... @@ -131,6 +130,19 @@
},
methods: {
...mapActions(['followArticle', 'praiseArticle', 'praiseComment']),
pxToRem() {
const rootValue = 40;
if (typeof px !== 'number') {
px = parseInt(`0${px}`);
}
if (px > 2) {
return (px / rootValue).toFixed(2) + 'rem';
} else {
return px + 'px';
}
},
changeBtnStatus() {
this.btnSelected = !this.btnSelected;
... ...
... ... @@ -229,7 +229,7 @@
if (result.code === 200) {
info.list = (info.list || []).concat(result.data.list);
info.page++;
info.totalPage = 10 || result.data.totalPage;
info.totalPage = result.data.totalPage;
info.lastedTime = result.data.lastedTime;
}
... ...