提交 585ad117 编写于 作者: 砖业洋__'s avatar 砖业洋__

step2 点击按钮两个hml页面相互跳转

上级 573aa752
{ {
"app":{ "app": {
"bundleName":"com.example.huxi", "bundleName": "com.example.huxi",
"vendor":"example", "vendor": "example",
"version":{ "version": {
"code":1, "code": 1,
"name":"1.0" "name": "1.0"
}, },
"apiVersion":{ "apiVersion": {
"compatible":3, "compatible": 3,
"target":3 "target": 3
} }
}, },
"deviceConfig":{}, "deviceConfig": {},
"module":{ "module": {
"deviceType":[ "deviceType": [
"liteWearable" "liteWearable"
], ],
"distro":{ "distro": {
"deliveryWithInstall":true, "deliveryWithInstall": true,
"moduleName":"entry", "moduleName": "entry",
"moduleType":"entry" "moduleType": "entry"
}, },
"abilities":[ "abilities": [
{ {
"name":"default", "name": "default",
"icon":"$media:icon", "icon": "$media:icon",
"label":"Huxi", "label": "Huxi",
"type":"page" "type": "page"
} }
], ],
"js":[ "js": [
{ {
"pages":[ "pages": [
"pages/index/index" "pages/index/index",
"pages/xunlian/xunlian"
], ],
"name":"default" "name": "default"
} }
] ]
} }
......
import router from '@system.router';
export default { export default {
data: { data: {
title: 'World' title: 'World'
}, },
clickAction() { clickAction() {
console.log("我被点击了") router.replace({
uri:"pages/xunlian/xunlian"
})
} }
} }
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 454px;
height: 454px;
}
.title {
font-size: 30px;
text-align: center;
width: 200px;
height: 100px;
}
.btn {
width:200px;
height:50px;
}
<div class="container">
<text class="title">
训练页面
</text>
<input type="button" value="返回" class="btn" onclick="clickAction"></input>
</div>
import router from '@system.router'
export default {
data: {
},
clickAction() {
router.replace({
uri:'pages/index/index' // 所有页面的uri都需要在config.json中定义
});
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册