qlg.frontend/js/notepad.js
2019-09-09 20:31:35 +08:00

57 lines
1.2 KiB
JavaScript

mui.plusReady(function(){
// some ajax
$(".footer").on("tap", ()=>{
app.create()
})
})
const app = new Vue({
el: '#app',
data() {
return {
noteData: [
],
counter: 0
}
},
created() {
console.log("Vue")
},
methods: {
triggerDelete(index) {
this.$set(this.noteData[index], 'currentDelete', true)
},
cancelDelete(index){
this.$set(this.noteData[index], 'currentDelete', false)
},
confirmDelete(index){
console.log("删除", this.noteData[index])
// some ajax
mui.toast("删除")
window.location.reload()
},
edit(index){
console.log("编辑", this.noteData[index])
// some ajax
mui.toast("编辑")
window.location.reload()
},
create(){
// some jump
if(this.counter < 10){
mui.toast("跳转")
this.counter ++ ;
}else{
mui.toast("开发中")
this.counter = 0;
JZL.openWindow('trade_rule.html', 'trade_rule.html')
}
}
},
mounted() {
// some ajax
this.noteData = [
{id: 1, name: '功能正在开发中', created_at: "2019-09-09 18:00:01", updated_at: "2019-09-09 18:09:09"},
{id: 2, name: '只是一个DEMO页', created_at: "2019-09-09 19:00:01", updated_at: "2019-09-09 20:09:09"},
]
}
})