for循环数组,然后通过数组的值v-model绑定了一个el-input-number输入框
,正常输入可以使用,但是加减号无效 :step设置了也没用
https://blog.csdn.net/TurtleOrange/article/details/89518721
change事件里是不是做处理了?
遍历的数组的tbdValue应该是没有赋初始值, 遍历的数组赋个初始值vue就可以正常监听使用加减号了
<template>
<div class="add">
<table border="0" class="base-view-form el-table">
<tr class="el-table_row">
<td class="cell">唱标项</td>
<td class="cell">唱标项</td>
<td class="cell">唱标项</td>
<td class="cell">唱标项</td>
</tr>
<tr class="el-table_row" v-for="(item,index) in tab" :key="index">
<td class="cell" width="25%">{{item.fillItems}}</td>
<td class="cell" width="25%">
<!-- <template> -->
<el-input-number v-model="item.value" @change="capital(item)" :min="1" label="描述文字" v-if="item.fillType"></el-input-number>
<!-- </template> -->
<input type="text" style="outline-style:none;border:1px solid #ccc;border-radius:3px;padding:14px 14px;width:90px;font-size:10px" v-if="!item.fillType" v-model="item.value" placeholder="请输入内容">
<span>{{item.value}}</span>
</td>
<td class="cell" width="25%">{{item.name}}</td>
<td class="cell" width="25%">{{item.actions}}</td>
</tr>
</table>
</div>
</template>
export default {
data(){
return{
tab:[
{
fillItems:'总价报价',
fillType:1,
name:'元',
actions:'总价报价',
value:''
},
{
fillItems:'工期',
fillType:0,
name:'月',
actions:'工期',
value:''
},
{
fillItems:'质量',
fillType:0,
name:'-',
actions:'质量',
value:''
},
{
fillItems:'质量',
fillType:0,
name:'测试',
actions:'测试',
value:''
}
]
}
},
mounted(){
},
methods:{
capital(value) {
console.log(value);
}
}
}