【发布时间】:2020-08-26 10:31:22
【问题描述】:
我正在尝试有条件地将 CSS 类应用于 b-table 中的一行(全部为 b-table-column),如下所示:
<b-table-column class="is-unselectable"
:cell-class="{ 'has-pointer-cursor': props.row.url != null }"
field="version" label="Name" :custom-sort="sortName" sortable>
<!-- Content -->
</b-table-column>
has-pointer-cursor 类存在于该vue 页面/组件的样式部分中。
我在控制台中收到此错误/警告:
[Vue 警告]:无效的道具:道具“cellClass”的类型检查失败。 期望值为“[object Object]”的字符串,得到对象
found in ---> <BTableColumn> <BTable> <MyPage> at src/views/MyPage.vue <App> at src/App.vue <Root>
但不知何故,它按预期工作(不考虑错误消息)!
发生了什么以及它如何仍然有效?有什么办法可以解决吗?
【问题讨论】: