<el-button size="mini" type="danger" @click="handleDelete(scope.row)" style="margin-top: 5px;">删除</el-button >
import {
getVocabularyList,
deleteVocabularyInfo
} from '../../common/api/writing.js'
export default {
data() {
return {
reqDeleteData: { //删除请求数据
data: {
id: 0, //词汇id
userId: 1, //用户
}
},
},
methods: {
handleDelete(row) { //删除
this.reqDeleteData.data.id = row.id
this.doDelete(row)
// this.doUpdate()
},
doDelete(row) { //执行删除
const that = this
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteVocabularyInfo(this.reqDeleteData).then(res => {
if (res.code == 0