...
|
...
|
@@ -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;
|
|
|
|
...
|
...
|
|