|
|
<template>
|
|
|
<ArticleDetail :share="true"></ArticleDetail>
|
|
|
<ArticleDetail :share="true" :set-share-data="setShareData"></ArticleDetail>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import Share from 'plugins/share';
|
|
|
import {getDetailShareData} from 'utils/share-handler';
|
|
|
import ArticleDetail from './article-detail';
|
|
|
|
|
|
export default {
|
|
|
name: 'ArticleDetailShare',
|
|
|
mounted() {
|
|
|
if (!this.$yoho.isApp) {
|
|
|
Share.init();
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
setShareData(article) {
|
|
|
if (!article) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let shareData = getDetailShareData(article);
|
|
|
|
|
|
document && (document.title = shareData.title);
|
|
|
console.log(shareData);
|
|
|
if (!this.$yoho.isApp) {
|
|
|
Share.setShareInfo(shareData);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
ArticleDetail
|
|
|
}
|
...
|
...
|
|