...
|
...
|
@@ -43,6 +43,7 @@ import ArticleItemTopics from '../article/article-item-topics'; |
|
|
import ArticleDetailFooter from './article-footer';
|
|
|
import ArticleItemSlideImage from '../article/article-item-slide-image';
|
|
|
import ArticleDetailHeader from './article-header';
|
|
|
import YAS from 'utils/yas-constants';
|
|
|
import {mapState, mapMutations, createNamespacedHelpers} from 'vuex';
|
|
|
const {mapState: mapArticleState} = createNamespacedHelpers('article');
|
|
|
|
...
|
...
|
@@ -77,7 +78,7 @@ export default { |
|
|
this.downgrade = true;
|
|
|
}
|
|
|
|
|
|
this.handleRechText();
|
|
|
this.handleRichText();
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['yoho']),
|
...
|
...
|
@@ -141,7 +142,7 @@ export default { |
|
|
},
|
|
|
watch: {
|
|
|
'data.richText': function() {
|
|
|
this.handleRechText();
|
|
|
this.handleRichText();
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
...
|
...
|
@@ -168,11 +169,25 @@ export default { |
|
|
},
|
|
|
onActionComment() {
|
|
|
},
|
|
|
handleRechText() {
|
|
|
handleRichText() {
|
|
|
let vm = this;
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.richText && this.$refs.richText.querySelectorAll('a').forEach(ele => {
|
|
|
if (ele.querySelector('img')) {
|
|
|
ele.classList.add('yoho-img-link');
|
|
|
|
|
|
ele.addEventListener('click', function() {
|
|
|
vm.$store.dispatch('reportYas', {
|
|
|
params: {
|
|
|
appop: YAS.eventName.articleImageClick,
|
|
|
param: {
|
|
|
ARTICLE_ID: vm.data.articleId,
|
|
|
URL: ele.getAttribute('href')
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
});
|
...
|
...
|
|