This is my <template>
code:
<div class="message-details pull-right small" style="display: none;">
<strong>Intent:</strong> {{ message.intent }} ({{ (message.confidence * 100).toFixed(2) + '%' }})
<br>
<strong>Entities:</strong>
{{ message.entities.map(e => `${e.type} = ${e.value}`).join('<br>') }}
...
other stuff
It renders as follows:
As you can see, instead of computing the second expression inside the brackets, it is rendered literally, while the first expression works fine.
What am I doing wrong?
答案 0 :(得分:0)
尝试一下:
{{ message.entities.map(e => e.type = e.value).join('\r\n') }}
并且您可以发布运行代码时出现的控制台错误吗?