Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js 如何在Vue中获取表中的行名和列号?_Vue.js_Columnheader_Vue Tables 2_Rowheader - Fatal编程技术网

Vue.js 如何在Vue中获取表中的行名和列号?

Vue.js 如何在Vue中获取表中的行名和列号?,vue.js,columnheader,vue-tables-2,rowheader,Vue.js,Columnheader,Vue Tables 2,Rowheader,是否有任何方法可以使用vue获取表的列号或位置以及行标题 到目前为止,输出是这样的 生成表时的代码: <table v-if="this.itemList.length > 0"> <thead class="ui-table-header-row"> <tr> <th class="ui-table-h

是否有任何方法可以使用vue获取表的列号或位置以及行标题

到目前为止,输出是这样的

生成表时的代码:

<table v-if="this.itemList.length > 0">
                    <thead class="ui-table-header-row">
                        <tr>
                            <th class="ui-table-header-cell l-padding"></th>
                            <th class="ui-table-header-cell center"  v-for="item in 31" :key="item.id">{{thisMonth}} July{{ item }}Day</th>

                        </tr>
                    </thead>
                        <template>
                            <tr>
                                <td></td>
                            </tr>
                            <tbody style="border-bottom:#dbb100 1px"  v-for="(item,index) in itemList" :key="index.id" >
                                <tr class="left-align">
                                    <td>{{item.name}}</td>
                                    <td v-for="(item,index) in costList" :key="index.id">{{item.total_work}}</td>
                                </tr>
                             </tbody>
                       </template>
</table>

{{本月}七月{{项目}日
{{item.name}
{{item.total_work}

在这一行
{{item.total_work}
,在显示值之前,我必须首先检查行标题名称是否与
成本列表中的
item.name
匹配。我发现有点接近我想要的输出,但我不知道如何使用vue重现它。非常感谢您提供的任何信息。

我复制了您包含在vue副本中的示例

newvue({
el:“应用程序”,
数据:{
天数:[1,2,3,4,5],
项目列表:[
{
名称:“苹果”
},
{
名称:“香蕉”
},
{
名字:“胡萝卜”
}
]
},
方法:{
警报(项目索引、日索引){
设item=this.itemList[item_index];
let day=这个.days[日指数];
警报(item.name+',Day'+Day);
}
}
})

天/时间
第{{Day}
{{item.name}
点击

我复制了您包含在其vue副本中的示例

newvue({
el:“应用程序”,
数据:{
天数:[1,2,3,4,5],
项目列表:[
{
名称:“苹果”
},
{
名称:“香蕉”
},
{
名字:“胡萝卜”
}
]
},
方法:{
警报(项目索引、日索引){
设item=this.itemList[item_index];
let day=这个.days[日指数];
警报(item.name+',Day'+Day);
}
}
})

天/时间
第{{Day}
{{item.name}
点击

我遇到了一个问题,每次使用该方法时,我的赋值都会更新。我的情况在那里得到了进一步的解释。我希望你能帮我。嗨,对不起。我不明白你的意思,这也是另一个问题。你能创建一个新的问题,并详细描述它,给我一个链接吗?请点击链接或跟随这个链接。谢谢,我有一个问题,我的赋值会在每次使用该方法时更新。我的情况在那里得到了进一步的解释。我希望你能帮我。嗨,对不起。我不明白你的意思,这也是另一个问题。你能创建一个新的问题,并详细描述它,给我一个链接吗?请点击链接或跟随这个链接。谢谢