vue.js - 如何获取 — 插值时显示为破折号
问题描述
在我正在处理的页面上,我试图将博客文章的标题读取为,其中和Sleep—It's frustratingly Important.
之间有一个破折号。以前我有这个硬编码为Sleep
It's
<h2 class="post-title"><router-link to="/posts/1">Sleep—It's frustratingly Important. </router-link></h2>
这工作正常。我想概括这一点,所以在我的 Rails 后端我将帖子标题存储为Sleep—It's frustratingly Important.
. 但是当我通过插值插入帖子标题时
<h2 class="post-title"><router-link to="/posts/1"> {{ this.posts[0].title }} </router-link></h2>
它不会插入破折号。它显示为“睡眠—It's frustratingly Important”。
为什么 html 不能识别 — 应该更改为破折号?我该如何解决这个问题?
解决方案
推荐阅读
- python - 使用 java 和 python 运行 docker 镜像
- python - the object doesn't move to the 'right' direction
- java - Assertj 只有当窗口显示分辨率降低到 1366X768 时,鼠标点击才有效
- git - How to pull some files from an old commit to the current master
- javascript - 如何使用jQuery检查鼠标是否远离元素?
- postgresql - PostgreSQL TO_CHAR() 删除月份字段的填充
- list - 按特定值从通用列表中获取所有项目
- python - 仅当列列表包含来自另一个列表的值时过滤行
- json - Import ndjson into elasticsearch 7.2 by command line
- php - Sort "orders" in batch of 4, based on most common products ordered