use

Click the table unit to directly input the value to modify the data

location

jiaqiCrp/src/page/productManagement/planInventory/liner/basic/subs/bus/comps/TableInputer/TableInputer.js

harvest

  1. throughpropsPasses a value to a child component, which can be returned by a method, and,scope-slotCan be used as an argument to this method
<template slot-scope="scope">
    <TableInputer
      :options="priceOptions(scope.row, scope.$index)"
    </TableInputer>
</template>
///
priceOptions:(row, index) => { 
    return {
        placeholder: row.name,
    }
},
Copy the code
  1. JSX mixed with render function
render: function(h){
    const show= this.inEdit?
    <div>
        <el-button size="mini" onClick={ this.close }></el-button>
        {
            h('el-input', ...)
        }
        <el-button size="mini" onClick={ this.close }></el-button>
    </div>
    :
    <span></span>
    return show;
}
Copy the code