【发布时间】:2020-01-25 15:05:58
【问题描述】:
我在我的Vuejs 项目中使用BootstrapVue,我在b-table-simple componentinb-thead table helper 中遇到了一个奇怪的问题"Invalid prop" 我将colspan 与数组长度绑定在一起,它总是给出一个数字,它工作正常,但它会生成控制台警告消息:
[Vue warn]: Invalid prop: custom validator check failed for prop "colspan".
found in
---> <BTh>
<BTr>
<BThead>
<BTableSimple>
<NationalTrends> at resources/js/components/trends/NationalTrends.vue
<Trends> at resources/js/components/trends/Trends.vue
<Root>
当我输入数字(4 或任何其他数字)时,它可以正常工作而不会在控制台中生成警告。
下面是我的代码:
<template>
<div>
<b-table-simple hover small caption-top responsive striped>
<caption>Commodity Trends</caption>
<b-thead head-variant="light">
<b-tr>
<b-th>Commodity</b-th>
<b-th>Current Month</b-th>
<b-th :colspan="selected_periods.length">Previous Period</b-th>
<b-th :colspan="selected_periods.length">% Change From the Previous Period</b-th>
<b-th :colspan="selected_periods.length" class="text-center">Direction of Change</b-th>
</b-tr>
</div>
</template>
请帮忙,我花了一个小时试图找出问题所在,但没有运气......
【问题讨论】:
标签: vuejs2 vue-component