【发布时间】:2018-02-21 13:11:12
【问题描述】:
我收到来自服务器的响应,其中包含 HTML 格式的 REST 请求。我已将其存储在 data:[] 中,当我在控制台上打印它时,它看起来像这样,即 HTML。这个回复是一个字符串,现在我的问题是在 JavaScript 中过滤它以使其成为一个对象数组
<table border='1' frame = 'void'>
<tr>
<th>name</th>
<th>age</th>
<th>date of birth</th>
</tr>
<tr>
<td>John</td>
<td>30</td>
<td>10.09.1987</td>
</tr>
</table>
我的问题是如何使用 vuejs 在对话框中显示这些 HTML 数据。 我希望这些值作为这样的对象数组
[
name,
age,
data of birth,
john,
30,
10.09.1987
]
【问题讨论】:
-
@Jeffrey 不,它不会存储在数组中,当我编写 console.log(this.data) 时,它会像这样打印
<table border='1' frame = 'void'> <tr> <th>name</th> <th>age</th> <th>date of birth</th> </tr> <tr> <td>John</td> <td>30</td> <td>10.09.1987</td> </tr> </table>。当我打印 console.log(this.data[0]) 它给我<
标签: javascript vue.js vuejs2 vuetify.js