laravel-5 - 将 v-html 属性与 vue-i18n 标签中的标记结合起来
问题描述
在我的 laravel 5.6/vue.js 2.5.7 / vue-i18n 7.8 我想用 html 标签显示语言标签,比如:
'votes_with_rating' => 'votes {related_votes_count} with rating `<b>{calc_artist_rating}</b>`',
并在 vue 文件中计算:
...
computed: {
votes_with_rating_value: function () {
return this.$tc( 'artist.votes_with_rating', { related_votes_count : this.artist.related_votes_count, calc_artist_rating:
this.calcArtistRating(this.artist.related_votes_count, this.artist.related_votes_sum, 1)} );
},
...
但结果与我预期的不同,因为没有呈现数字: https ://imgur.com/a/0rWRTvE 如果不使用
<span v-html
那么输出是有效的......哪个是正确的方法?谢谢!
解决方案
推荐阅读
- analytics - 从我的 Apigee 付费组织中删除分析区域
- javascript - 遵循 GDPR 指南的 Cookie 同意逻辑
- node.js - 运行容器时 Docker 将文件挂载到我的本地系统
- css - Firefox 无法在 100% 高度的 div 中正确包装包含的图像
- php - 调用字符串上的成员函数 addEagerConstraints() - Laravel 8
- javascript - 重新渲染时未获得更新的宽度/高度
- python - 如何删除在指定列上重复的行?
- r - 学习对子集数据进行 R-Code 审查
- matlab - 为什么matlab中的tqwt函数会报错?
- python - 使用 Python 脚本删除 Raspberry Pi 上的文件 - 权限错误