var vm = new Vue({
el: '#app',
data: {
tabIndex: 0,
isCarrier: false,
carrierDispute: {
infoId:"${mbInfo.infoId}",
title:"${mbInfo.title}",
brief:"${mbInfo.brief}",
content:"${mbInfo.content}",
item: [],
addAttachmentList: [
<#if mbInfo.addAttachmentList?exists>
<#list mbInfo.addAttachmentList as attachment>
${attachment.id}
${attachment.orderNo}
${attachment.attachmentName}
${attachment.attachmentUrl}
</#list>
</#if>
]
}
},
这样输出,运行时在${attachment.id}就报错:Uncaught SyntaxError: Invalid or unexpected token
addAttachmentList: [
1300cedb0fc311e9ae5528e347618294
12fdc19a0fc311e9ae5528e347618294
7.png http://10.1.8.41:80/group1/M00/00/36/CgEIKVwuu82AIsuCAACbuTufRlw141.png
13049f6c0fc311e9ae5528e347618294
12fdc19a0fc311e9ae5528e347618294
8.png
http://10.1.8.41:80/group1/M00/00/36/CgEIKVwuu8-AQmYAAABlM71NEyI301.png
1305fefd0fc311e9ae5528e347618294
12fdc19a0fc311e9ae5528e347618294
9.png
http://10.1.8.41:80/group1/M00/00/36/CgEIKVwuu9GAGd3sAABlnVKB4kg072.png
]
这个不是合法的
JS
代码,如果只是想把字符串赋值到 JS 数组中,就加上引号和逗号呀上面只是示例代码,需要实现什么还要自己调整