-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathxv-base-vue-page.ts
executable file
·66 lines (56 loc) · 1.54 KB
/
xv-base-vue-page.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { Component, Vue } from "vue-property-decorator";
import { AlertServiceProvider } from "@/providers/alert-service/alert-service";
import { AppServiceProvider } from "@/providers/app-service/app-service";
import { AppModule } from "@/store/modules/app";
@Component({
components: {}
})
export default class {{XV_PAGE_NAME}} extends Vue {
appService = new AppServiceProvider();
alertService = new AlertServiceProvider();
data = {
title: "标题",
displayed: false
};
/**
* 改变显示或隐藏状态
*/
changeDisplayed(){
this.data.displayed = !this.data.displayed;
}
created() {
AppModule.setTitle(this.data.title);
}
mounted() {
console.log("page mounted");
// this.getData();
}
activated() {
console.log("activated");
}
deactivated() {
console.log("deactivated");
}
alert() {
this.alertService.alert("操作成功");
}
confirm() {
this.alertService.confirm(
"确认操作?",
() => {
this.alertService.message("你点了确认。");
},
() => {
this.alertService.message("你点了取消。");
}
);
}
getData() {
// this.appService.get("news/listNews", { id: 1 }, data => {
// this.data.title = data.message;
// });
// this.appService.post("news/listNews", { id: 2 }, data => {
// this.data.title = data.message;
// });
}
}