Initial DSHWatch DSHWatch scaffold

This commit is contained in:
2026-09-01 14:25:34 +08:00
commit 25798241db
21 changed files with 10616 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
<script>
export default {
onCreate() {
console.log("app created")
},
onDestroy() {
console.log("app destroyed")
}
}
</script>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

+1
View File
@@ -0,0 +1 @@
{}
+1
View File
@@ -0,0 +1 @@
{"a":{"b":"default hello"}}
+1
View File
@@ -0,0 +1 @@
{"a":{"b":"hello"}}
+1
View File
@@ -0,0 +1 @@
{"a":{"b":"你好"}}
+31
View File
@@ -0,0 +1,31 @@
{
"package": "com.application.watch.demo",
"name": "DSHWatch",
"versionName": "1.0.0",
"versionCode": 1,
"minPlatformVersion": 1000,
"icon": "/common/logo.png",
"deviceTypeList": [
"watch"
],
"features": [
{
"name": "system.router"
}
],
"config": {
"logLevel": "log",
"designWidth": "device-width"
},
"router": {
"entry": "pages/index",
"pages": {
"pages/index": {
"component": "index"
},
"pages/detail": {
"component": "detail"
}
}
}
}
+26
View File
@@ -0,0 +1,26 @@
<template>
<div class="demo-page">
<text class="title">{{ text }}</text>
</div>
</template>
<script>
export default {
private: {
text: "欢迎打开详情页"
}
}
</script>
<style>
.demo-page {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 20px;
text-align: center;
}
</style>
+48
View File
@@ -0,0 +1,48 @@
<template>
<div class="demo-page">
<text class="title">{{ $t("a.b") }},欢迎打开{{ title }}</text>
<!-- 点击跳转详情页 -->
<input class="btn" type="button" value="跳转到详情页" onclick="routeDetail" />
</div>
</template>
<script>
import router from "@system.router"
export default {
// 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
private: {
title: "示例页面"
},
routeDetail() {
// 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
router.push({
uri: "/pages/detail"
})
}
}
</script>
<style>
.demo-page {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 20px;
text-align: center;
}
.btn {
width: 200px;
height: 40px;
margin-top: 20px;
border-radius: 5px;
background-color: #09ba07;
font-size: 20px;
color: #ffffff;
}
</style>