[英]Page is displaying plain html text instead of rendering the html table
I want to display html table by assigning the html text to one variable and returning that variable and passing the html code in an json array format like below. I want to display html table by assigning the html text to one variable and returning that variable and passing the html code in an json array format like below.
[{
"fruit": "apple",
"flower": "jasmine",
"capacity": "0",
"flavor": "jasm",
"numbers": "1",
"nic": "1",
"ram": "4",
"source": "flower",
"details": "<table id=\"details-0\" class=\"table-striped\"><tr><td>type</td><td>static</td></tr><tr><td>template_name</td><td>gold-sti-rh74-stage-use-only</td></tr><tr><td>template_guid</td><td>ec5c9b84c8857bfa91d11d1527250bf7</td></tr><tr><td>flavor</td><td>m1.Small</td></tr><tr><td>num_cpu</td><td>1</td></tr><tr><td>ram</td><td>4</td></tr><tr><td>num_nic</td><td>1</td></tr></table>",
"id": 0
}]
But when page loads, I am getting the plain html text with tr> etc... and I am not getting the table format.但是当页面加载时,我得到了带有 tr> 等的普通 html 文本......而且我没有得到表格格式。 Please help me with this issue.请帮我解决这个问题。
var _list_data = [];
var details = '<table id="details-'+i+'" class="table-striped">';
details += '<tr><td>type</td><td>static</td></tr><tr><td>template_name</td> </tr>';
details += '</table>';
_list_data['details'] = (details);
return _list_data;
This returns the plain html code in page.这将返回页面中的普通 html 代码。 I need to make it as proper table format.我需要将其设为正确的表格格式。 we can use v-html in vue js, but this response is sending to library.我们可以在 vue js 中使用 v-html,但是这个响应正在发送到库。 How can we edit library file by adding v-html, that should not be proper way right?我们如何通过添加 v-html 来编辑库文件,这不应该是正确的方法吗? I am confused.我很困惑。
var _list_data = []; var details = '<table id="details-' + i + '" class="table-striped">'; details += '<tr><td>type</td><td>static</td></tr><tr><td>template_name</td> </tr>'; details += '</table>'; _list_data['details'] = (details); return _list_data;
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.