vue 封装dialog_element-dialog封装成子组件
移除
{{Edit}}
import UserEditfrom "./UserEdit-dialog.vue";
import updatefrom ‘./Update.vue‘exportdefault{
methods: {
deleteRow(index, rows) {
rows.splice(index,1);
}
},
data() {return{
Edit:"編輯",
pagesize:5, //每頁的數據條數
currentPage: 1, //默認開始頁面
show: false,
shows:false,
mydata:{},
SkipCount:5,
MaxResultCount:10,
actions: [
[
{
id:"New",
type:"primary",
text:"New",
icon:"fa fa-plus"},
{
id:"Refresh",
type:"success",
text:"Refresh",
icon:"fa fa-refresh"}
]
],
tableData4: []
};
},
components: {
UserEdit,
datatablepaging,
update
},
methods: {
open() {this.show = true;
},
opens(){this.shows = true;
},
created: function() {this.total = this.tableData4.length;
},
current_change: function(currentPage) {this.currentPage =currentPage;
},
handleClick(id) {switch(id) {case "New":this.AddUser();break;case "Refresh":this.Refresh();break;default:break;
}
},
AddUser() {this.open();
},
Refresh() {this.getuser();
},
getuser() {this.$http
.get("/api/services/app/Userinfro/GetUserinofor?MaxResultCount=" +
this.MaxResultCount
)
.then(result=>{this.tableData4 =result.data.result.items;//console.log(result.data.result.items);
})
.catch(err =>{
console.log(err);
});
},
sexTypes(row, column) {if (row.sexType == 1) {return "男";
}else{return "女";
}
},
Getlevel(row, column) {if (row.integral >= 300 && row.integral < 600) {return "白銀";
}if (row.integral >= 600 && row.integral < 900) {return "黃金";
}if (row.integral >= 900 && row.integral < 1200) {return "鉑金";
}if (row.integral >= 1200) {return "鉆石";
}
},
deleteRow(row) {this.$confirm("此操作將永久刪除該用戶, 是否繼續?", "提示", {
confirmButtonText:"確定",
cancelButtonText:"取消",
type:"warning"}).then(()=>{
console.log(row.id);this.$http
.delete("/api/services/app/Userinfro/DeleteUserByid?Id=" +row.id)
.then(result=>{this.$message({
type:"success",
message:"刪除成功!"});this.getuser();
})
.catch(err =>{
console.log(err);
});
});
},
EditClick(data) {this.opens();//console.log(data)
this.mydata=data;
},
handleSizeChange(size){this.pagesize=size;
},
handleCurrentChange(currentPage)
{this.currentPage=currentPage;
}
},
created() {this.getuser();
}
};
padding-top: 12px;
}
總結
以上是生活随笔為你收集整理的vue 封装dialog_element-dialog封装成子组件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 上海欢乐谷停车场怎么收费
- 下一篇: java post 500_Post请