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
| <template>
| <!-- template里只能有一个根节点 -->
| <div class="demo-page">
| <text class="title">欢迎打开{{title}}</text>
| <!-- 点击跳转详情页 -->
| <input class="btn" type="button" value="跳转到详情页" @click="routeDetail" />
| </div>
| </template>
|
| <script>
| import router from '@system.router'
|
| export default {
| // 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
| private: {
| title: '示例页面'
| },
| methods: {
| routeDetail () {
| // 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
| router.push ({
| uri: '/DemoDetail'
| })
| }
| }
| }
| </script>
|
| <style>
| .demo-page {
| flex-direction: column;
| justify-content: center;
| align-items: center;
| width: 100%;
| }
|
| .title {
| font-size: 40px;
| text-align: center;
| }
|
| .btn {
| width: 550px;
| height: 86px;
| margin-top: 75px;
| border-radius: 43px;
| background-color: #09ba07;
| font-size: 30px;
| color: #ffffff;
| }
| </style>
|
|