vuejs2 - 在类条件中设置默认手风琴项时出错
问题描述
在我的 laravel 5.7 / Vuejs ( vue": "^2.6.10" ) / "bootstrap": "^4.3.1" 应用程序中使用手风琴,我想在调试目的中显示 1 块 openec,模板如下:
<div :id="'collapse'+nextStateWithRegion.id" v-bind:class="'collapse'+{ ' show' : nextStateWithRegion.id == debugging_state_id }" :aria-labelledby="'heading'+nextStateWithRegion.id"
data-parent="#accordion_hostels_by_location">
<div class="card-body">
<!--{{ nextStateWithRegion.regionsOfStateArray }}-->
<ul>
<li v-for="nextRegionOfState, index in nextStateWithRegion.regionsOfStateArray" :key="nextRegionOfState.id">
<!--nextRegionOfState::{{ nextRegionOfState }}-->
<router-link :to="{ name: 'hostelsByRegion', params: { region_id: nextRegionOfState.id, state_id : nextRegionOfState.state_id } }"
class="nav-link">{{ nextRegionOfState.name }}
<small>( {{ nextRegionOfState.related_common_hostels_count }} hostels with {{ nextRegionOfState.related_featured_hostels_count }}
featured)</small>
</router-link>
</li>
</ul>
</div>
</div>
但结果不同,因为我看到的不是“显示”字符串添加到类中,而是“[object Object]”: https ://imgur.com/a/YWenuxh
哪种方式是正确的?
谢谢!
解决方案
推荐阅读
- android - 打开任何布局文件时,Android Studio 崩溃
- php - 如何在 PHP 中获取另一个类中设置的 Class 属性
- wordpress - 如何强制用户在 input type='tel' Wp Contact Form 7 Plugin 中仅输入数字,就像 Gravity Form 插件一样
- r - 有没有办法在 R 函数中为数据框中的每个子集赋予不同的对象名称?
- python - 抓取脚本提供的 JSON 并转换为数据框
- if-statement - Google 表格在指定时间之前和之后的工作时间
- python - 使用 .bat 文件中的“调用”to.py 脚本时出错
- odoo - 单击保存按钮后odoo服务器错误
- r - 如果所有值都符合 R 中的条件,则选择行
- python-3.x - 将两列数据合二为一,不影响数据值