Commit a02e3eaa by xuzhenghua

分享

parent 5457b3fc
...@@ -45,6 +45,7 @@ class Landing extends Component { ...@@ -45,6 +45,7 @@ class Landing extends Component {
landing.style.minHeight = `${window.innerHeight}px` landing.style.minHeight = `${window.innerHeight}px`
boxContainer.style.minHeight = `${window.innerHeight}px` boxContainer.style.minHeight = `${window.innerHeight}px`
} }
this.createMeta();
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
...@@ -53,6 +54,26 @@ class Landing extends Component { ...@@ -53,6 +54,26 @@ class Landing extends Component {
} }
} }
createMeta = () => {
let meta = document.createElement('meta');
meta.setAttribute('name', 'description')
meta.setAttribute('itemprop', 'description')
meta.setAttribute('content', '这里是自定义分享的描述')
let meta2 = document.createElement('meta');
meta2.setAttribute('itemprop', 'name')
meta2.setAttribute('content', '这里是标题')
let meta3 = document.createElement('meta');
meta3.setAttribute('itemprop', 'image')
meta3.setAttribute('content', 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/wx-share-icon.png')
let head = document.getElementsByTagName('head')[0];
head.appendChild(meta);
head.appendChild(meta2);
head.appendChild(meta3);
}
componentWillUnmount() { componentWillUnmount() {
this.shareTipPopup && this.shareTipPopup.remove() this.shareTipPopup && this.shareTipPopup.remove()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment