VueJs + Element
话不多说,直接贴错:
_self.$scopedSlots.default is not a function
<el-table stripe border ref="tableData" max-height="500" v-loading="loading" v-bind:data="tableData" @row-dblclick="doubbleClick" row-key="new_srv_partsapplylineId" key="lines"> <el-table-column type="selection" width="50" :selectable="isSelectedTable"> </el-table-column> <el-table-column key="exchange" prop="exchange" :label="$t('attach.list_operate')"> <template slot-scope="scope"> <el-button type="text" @click="gotoChangePartPage(scope.row)">{{$t('partsApply.line_btn_changeparts')}}</el-button> </template> </el-table-column> <el-table-column key="new_partsid" prop="new_partsid.name" :label="$t('partsApply.line_filed_new_partsid')"> <template slot-scope="scope"> <el-button type="text" @click="gotoEditLinePage(scope.row)">{{scope.row.new_partsid.name}}</el-button> </template> </el-table-column> <el-table-column key="new_applyqty" prop="new_applyqty" :label="$t('partsApply.line_filed_new_applyqty')"> </el-table-column> <el-table-column key="new_approvedqty" prop="new_approvedqty" :label="$t('partsApply.line_filed_new_approvedqty')" v-if="this.type == 2 || this.type == 3" width="100"> <template slot-scope="scope"> <el-input type="number" :id="scope.row.new_srv_partsapplylineId+'approve'" v-model="scope.row.new_approvedqty" :disabled="!isBtnAcceptEnable" min="0" @blur="qtyBlur(scope.row)"></el-input> </template> </el-table-column> <el-table-column key="new_confirmqty" prop="new_confirmqty" :label="this.type === 2 ? $t('partsApply.line_filed_new_assignqty') : $t('partsApply.line_filed_new_confirmqty')" width="100"> <template slot-scope="scope"> <el-input type="number" :id="scope.row.new_srv_partsapplylineId+'confirm'" v-model="scope.row.new_confirmqty" :disabled="!isBtnAcceptEnable" min="0" @blur="qtyBlur(scope.row)"></el-input> </template> </el-table-column> <el-table-column key="new_amount" prop="new_amount" :label="$t('partsApply.line_filed_new_amount')" v-if="this.type == 2 || this.type == 3"> </el-table-column> <el-table-column key="new_iscontrolname" prop="new_iscontrolname" :label="$t('partsApply.line_filed_new_iscontrolname')" v-if="this.type == 1 || this.type == 3"> </el-table-column> <el-table-column key="new_agentqty" prop="new_agentqty" :label="$t('partsApply.line_filed_new_agentqty')" v-if="this.type==2 || (this.type==3&&this.applyto==1"> </el-table-column> <el-table-column key="new_servicecompanyqty" prop="new_servicecompanyqty" :label="$t('partsPurchaseOrSale.line_filed_new_servicecompanyqty')" v-if="this.type==3&&this.applyto==2"> </el-table-column>
</el-table>
解决方法:
第一次,给<el-table>加上属性 key 失败
第二次,给<el-inpurt>加上属性 name 失败,加上 key 失败
第三次,给<el-table-column>加上属性 key 成功