I want to add the json object in the script label , which would be changed in different page, so i try to write as follows:
head(){
const vm = this;
var html = JSON.stringify({
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
"@id": vm.$route.fullPath,
"appid": "1572719465218098",
"title": vm.tdk.title,
"images": [
"https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png",
"https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo_top_ca79a146.png ",
"https://m.baidu.com/static/index/plus/plus_logo.png "
],
"description": vm.tdk.desc,
"pubDate": "2017-08-15T08:00:01"
});
return {
title: this.tdk.title,
meta: [
{hid: 'description', name: 'description', content: this.tdk.desc},
{hid: 'keyword', name: 'keywords', content: this.tdk.keys}
],
link: [{rel: "canonical", href: this.url}],
script:[
{
type: "application/ld+json",
innerHTML: html
}
]
}
}
howerer , when i check the code in my web pgae , the quotation marks in json object in the script label had been transformed to '"' , just like this
<script data-n-head="true" type="application/ld+json">
{"@context"
:"https://ziyuan.baidu.com/contexts/cambrian.jsonld"
,"@id"
:"/news/detail-28545",
"appid":"1572719465218098","title":"
钢铁价格 2017年12月1日乐从钢铁世界价格_手机钢铁世界网",
"images":["https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png","https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo_top_ca79a146.png ","https://m.baidu.com/static/index/plus/plus_logo.png "]
,"description":"
手机昨日,唐山普碳方坯再涨30元至3890元/吨含税出厂,准备破3900元大关;成材价格继续上涨,特别是螺纹钢,部分地区的螺纹已经比冷轧价格还要高;昨日钢铁世界地磅指数录得114点,出货状况异常火爆!今日早盘,期螺、热卷期货涨势有所回落,但原燃料期货延续涨势,下面来看今早最新价格情况。","pubDate":"2017-08-15T08:00:01"}</script>
so i want to know how could i avoid this problem , that the quotations marks be transformed to '"' thanks a lot looking forward to your reply tks
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2053">#c2053</a>)</em></sub></div>