create-aiot 2.0.5-widget-provider-beta.2 → 2.0.6-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,26 +1,26 @@
1
- # `create-aiot`
2
-
3
- 新建 vela 项目的工具,可指定项目名称、模板、启用的工具(例如 eslint)等。
4
-
5
- ## 使用
6
-
7
- ### 命令
8
-
9
- `npm create aiot`
10
-
11
- 仅输入命令,会使用询问的方式获取各项参数。
12
-
13
- 也可直接输入参数,避免询问,示例:`npm create aiot --name my-project`
14
-
15
- ### 参数列表
16
-
17
- | 参数名 | 描述 | 类型 | 默认值 |
18
- | -------- | ----------- | ------ | ------------ |
19
- | name | 项目名称 | string | aiot-project |
20
- | v | 项目版本 | string | 1.0.0 |
21
- | template | 模板名称 | string | 无 |
22
- | eslint | 启用 eslint | string | false |
23
-
24
- ## 贡献模板
25
-
26
- 待定
1
+ # `create-aiot`
2
+
3
+ 新建 vela 项目的工具,可指定项目名称、模板、启用的工具(例如 eslint)等。
4
+
5
+ ## 使用
6
+
7
+ ### 命令
8
+
9
+ `npm create aiot`
10
+
11
+ 仅输入命令,会使用询问的方式获取各项参数。
12
+
13
+ 也可直接输入参数,避免询问,示例:`npm create aiot --name my-project`
14
+
15
+ ### 参数列表
16
+
17
+ | 参数名 | 描述 | 类型 | 默认值 |
18
+ | -------- | ----------- | ------ | ------------ |
19
+ | name | 项目名称 | string | aiot-project |
20
+ | v | 项目版本 | string | 1.0.0 |
21
+ | template | 模板名称 | string | 无 |
22
+ | eslint | 启用 eslint | string | false |
23
+
24
+ ## 贡献模板
25
+
26
+ 待定
@@ -1,17 +1,17 @@
1
- [
2
- {
3
- "type": "ux",
4
- "demoList": [
5
- {
6
- "name": "vela-demo",
7
- "path": "./ux/vela-demo",
8
- "description": "vela demo template"
9
- },
10
- {
11
- "name": "android-demo",
12
- "path": "./ux/android-demo",
13
- "description": "android demo template"
14
- }
15
- ]
16
- }
17
- ]
1
+ [
2
+ {
3
+ "type": "ux",
4
+ "demoList": [
5
+ {
6
+ "name": "vela-demo",
7
+ "path": "./ux/vela-demo",
8
+ "description": "vela demo template"
9
+ },
10
+ {
11
+ "name": "android-demo",
12
+ "path": "./ux/android-demo",
13
+ "description": "android demo template"
14
+ }
15
+ ]
16
+ }
17
+ ]
@@ -1,25 +1,25 @@
1
- ## 快速上手
2
-
3
- ### 1. 开发
4
-
5
- ```
6
- npm install
7
- npm run start
8
- ```
9
-
10
- ### 2. 构建
11
-
12
- ```
13
- npm run build
14
- npm run release
15
- ```
16
-
17
- ### 3. 调试
18
-
19
- ```
20
- npm run watch
21
- ```
22
-
23
- ## 了解更多
24
-
25
- 你可以通过我们的[官方文档](https://iot.mi.com/vela/quickapp)熟悉和了解快应用。
1
+ ## 快速上手
2
+
3
+ ### 1. 开发
4
+
5
+ ```
6
+ npm install
7
+ npm run start
8
+ ```
9
+
10
+ ### 2. 构建
11
+
12
+ ```
13
+ npm run build
14
+ npm run release
15
+ ```
16
+
17
+ ### 3. 调试
18
+
19
+ ```
20
+ npm run watch
21
+ ```
22
+
23
+ ## 了解更多
24
+
25
+ 你可以通过我们的[官方文档](https://iot.mi.com/vela/quickapp)熟悉和了解快应用。
@@ -1,5 +1,5 @@
1
- /.nyc_output
2
- /coverage
3
- /node_modules
4
- /dist
1
+ /.nyc_output
2
+ /coverage
3
+ /node_modules
4
+ /dist
5
5
  /build
@@ -1,17 +1,17 @@
1
- {
2
- "name": "{{ appName }}",
3
- "version": "1.0.0",
4
- "description": "",
5
- "engines": {
6
- "node": ">=8.10"
7
- },
8
- "scripts": {
9
- "start": "aiot start",
10
- "build": "aiot build",
11
- "release": "aiot release",
12
- "lint": "eslint --format codeframe --fix --ext .ux,.js src/"
13
- },
14
- "devDependencies": {
15
- "aiot-toolkit": "^{{ toolkitVersion }}"
16
- }
17
- }
1
+ {
2
+ "name": "{{ appName }}",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "engines": {
6
+ "node": ">=8.10"
7
+ },
8
+ "scripts": {
9
+ "start": "aiot start",
10
+ "build": "aiot build",
11
+ "release": "aiot release",
12
+ "lint": "eslint --format codeframe --fix --ext .ux,.js src/"
13
+ },
14
+ "devDependencies": {
15
+ "aiot-toolkit": "^{{ toolkitVersion }}"
16
+ }
17
+ }
@@ -1,24 +1,24 @@
1
- <template>
2
- <!-- template里只能有一个根节点 -->
3
- <div class="demo-page">
4
- <text>{{text}}</text>
5
- <text>{{des}}</text>
6
- </div>
7
- </template>
8
-
9
- <script>
10
- export default {
11
- private: {
12
- text: '欢迎使用快应用卡片',
13
- des: '卡片是一种轻量级的快应用,快应用卡片使快应用能够在其他app和系统里提供可扩展的app功能'
14
- }
15
- }
16
- </script>
17
-
18
- <style>
19
- .demo-page {
20
- flex: 1;
21
- flex-direction: column;
22
- align-items: center;
23
- }
24
- </style>
1
+ <template>
2
+ <!-- template里只能有一个根节点 -->
3
+ <div class="demo-page">
4
+ <text>{{text}}</text>
5
+ <text>{{des}}</text>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ private: {
12
+ text: '欢迎使用快应用卡片',
13
+ des: '卡片是一种轻量级的快应用,快应用卡片使快应用能够在其他app和系统里提供可扩展的app功能'
14
+ }
15
+ }
16
+ </script>
17
+
18
+ <style>
19
+ .demo-page {
20
+ flex: 1;
21
+ flex-direction: column;
22
+ align-items: center;
23
+ }
24
+ </style>
@@ -1,48 +1,48 @@
1
- <template>
2
- <!-- template里只能有一个根节点 -->
3
- <div class="demo-page">
4
- <text class="title">欢迎打开{{title}}</text>
5
- <!-- 点击跳转详情页 -->
6
- <input class="btn" type="button" value="跳转到详情页" onclick="routeDetail" />
7
- </div>
8
- </template>
9
-
10
- <script>
11
- import router from '@system.router'
12
-
13
- export default {
14
- // 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
15
- private: {
16
- title: '示例页面'
17
- },
18
- routeDetail () {
19
- // 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
20
- router.push ({
21
- uri: '/DemoDetail'
22
- })
23
- }
24
- }
25
- </script>
26
-
27
- <style>
28
- .demo-page {
29
- flex-direction: column;
30
- justify-content: center;
31
- align-items: center;
32
- }
33
-
34
- .title {
35
- font-size: 40px;
36
- text-align: center;
37
- }
38
-
39
- .btn {
40
- width: 550px;
41
- height: 86px;
42
- margin-top: 75px;
43
- border-radius: 43px;
44
- background-color: #09ba07;
45
- font-size: 30px;
46
- color: #ffffff;
47
- }
48
- </style>
1
+ <template>
2
+ <!-- template里只能有一个根节点 -->
3
+ <div class="demo-page">
4
+ <text class="title">欢迎打开{{title}}</text>
5
+ <!-- 点击跳转详情页 -->
6
+ <input class="btn" type="button" value="跳转到详情页" onclick="routeDetail" />
7
+ </div>
8
+ </template>
9
+
10
+ <script>
11
+ import router from '@system.router'
12
+
13
+ export default {
14
+ // 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
15
+ private: {
16
+ title: '示例页面'
17
+ },
18
+ routeDetail () {
19
+ // 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
20
+ router.push ({
21
+ uri: '/DemoDetail'
22
+ })
23
+ }
24
+ }
25
+ </script>
26
+
27
+ <style>
28
+ .demo-page {
29
+ flex-direction: column;
30
+ justify-content: center;
31
+ align-items: center;
32
+ }
33
+
34
+ .title {
35
+ font-size: 40px;
36
+ text-align: center;
37
+ }
38
+
39
+ .btn {
40
+ width: 550px;
41
+ height: 86px;
42
+ margin-top: 75px;
43
+ border-radius: 43px;
44
+ background-color: #09ba07;
45
+ font-size: 30px;
46
+ color: #ffffff;
47
+ }
48
+ </style>
@@ -1,27 +1,27 @@
1
- <template>
2
- <!-- template里只能有一个根节点 -->
3
- <div class="demo-page">
4
- <text class="title">{{text}}</text>
5
- </div>
6
- </template>
7
-
8
- <script>
9
- export default {
10
- private: {
11
- text: '欢迎打开详情页'
12
- }
13
- }
14
- </script>
15
-
16
- <style>
17
- .demo-page {
18
- flex-direction: column;
19
- justify-content: center;
20
- align-items: center;
21
- }
22
-
23
- .title {
24
- font-size: 40px;
25
- text-align: center;
26
- }
27
- </style>
1
+ <template>
2
+ <!-- template里只能有一个根节点 -->
3
+ <div class="demo-page">
4
+ <text class="title">{{text}}</text>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ export default {
10
+ private: {
11
+ text: '欢迎打开详情页'
12
+ }
13
+ }
14
+ </script>
15
+
16
+ <style>
17
+ .demo-page {
18
+ flex-direction: column;
19
+ justify-content: center;
20
+ align-items: center;
21
+ }
22
+
23
+ .title {
24
+ font-size: 40px;
25
+ text-align: center;
26
+ }
27
+ </style>
@@ -1,14 +1,14 @@
1
- <script>
2
- /**
3
- * @file 应用级别的配置,供所有页面公用
4
- * 可在app.ux导出公用变量
5
- * 其他src目录下的ux文件使用this.$app.$def.<paramName>即可调用此处导出的变量
6
- * 文档地址: https://doc.quickapp.cn/framework/source-file.html#appux
7
- */
8
-
9
- // 引入全局函数定义文件global.js
10
- import './global'
11
-
12
- export default {}
13
-
14
- </script>
1
+ <script>
2
+ /**
3
+ * @file 应用级别的配置,供所有页面公用
4
+ * 可在app.ux导出公用变量
5
+ * 其他src目录下的ux文件使用this.$app.$def.<paramName>即可调用此处导出的变量
6
+ * 文档地址: https://doc.quickapp.cn/framework/source-file.html#appux
7
+ */
8
+
9
+ // 引入全局函数定义文件global.js
10
+ import './global'
11
+
12
+ export default {}
13
+
14
+ </script>
@@ -1,34 +1,34 @@
1
- /**
2
- * @file 全局能力的配置与获取
3
- * 文档地址:https://doc.quickapp.cn/tutorial/framework/optimization-skills.html#%E4%BD%BF%E7%94%A8-globaljs
4
- */
5
-
6
- function getGlobalRef() {
7
- return Object.getPrototypeOf(global) || global
8
- }
9
-
10
- const quickappGlobal = getGlobalRef()
11
-
12
- /**
13
- * 设置全局(被APP与Page共享)数据;
14
- * @param key {string}
15
- * @param val {*}
16
- */
17
- function setGlobalData(key, val) {
18
- quickappGlobal[key] = val
19
- }
20
-
21
- /**
22
- * 获取全局(被APP与Page共享)数据;
23
- * @param key {string}
24
- * @return {*}
25
- */
26
- function getGlobalData(key) {
27
- return quickappGlobal[key]
28
- }
29
-
30
- // 两个方法默认定义在全局
31
- setGlobalData('setGlobalData', setGlobalData)
32
- setGlobalData('getGlobalData', getGlobalData)
33
-
34
- export { setGlobalData, getGlobalData }
1
+ /**
2
+ * @file 全局能力的配置与获取
3
+ * 文档地址:https://doc.quickapp.cn/tutorial/framework/optimization-skills.html#%E4%BD%BF%E7%94%A8-globaljs
4
+ */
5
+
6
+ function getGlobalRef() {
7
+ return Object.getPrototypeOf(global) || global
8
+ }
9
+
10
+ const quickappGlobal = getGlobalRef()
11
+
12
+ /**
13
+ * 设置全局(被APP与Page共享)数据;
14
+ * @param key {string}
15
+ * @param val {*}
16
+ */
17
+ function setGlobalData(key, val) {
18
+ quickappGlobal[key] = val
19
+ }
20
+
21
+ /**
22
+ * 获取全局(被APP与Page共享)数据;
23
+ * @param key {string}
24
+ * @return {*}
25
+ */
26
+ function getGlobalData(key) {
27
+ return quickappGlobal[key]
28
+ }
29
+
30
+ // 两个方法默认定义在全局
31
+ setGlobalData('setGlobalData', setGlobalData)
32
+ setGlobalData('getGlobalData', getGlobalData)
33
+
34
+ export { setGlobalData, getGlobalData }
@@ -1,56 +1,56 @@
1
- {
2
- "package": "com.application.demo",
3
- "name": "{{appName}}",
4
- "versionName": "1.0.0",
5
- "versionCode": 1,
6
- "minPlatformVersion": 1070,
7
- "icon": "/Common/logo.png",
8
- "deviceTypeList": ["phone"],
9
- "features": [
10
- { "name": "system.prompt" },
11
- { "name": "system.router" },
12
- { "name": "system.shortcut" }
13
- ],
14
- "permissions": [
15
- { "origin": "*" }
16
- ],
17
- "config": {
18
- "logLevel": "log"
19
- },
20
- "router": {
21
- "entry": "Demo",
22
- "pages": {
23
- "Demo": {
24
- "component": "index"
25
- },
26
- "DemoDetail": {
27
- "component": "index"
28
- }
29
- },
30
- "widgets": {
31
- "CardDemo": {
32
- "name": "CardDemo",
33
- "description": "快应用卡片展示",
34
- "component": "index",
35
- "path": "/CardDemo",
36
- "features": []
37
- }
38
- }
39
- },
40
- "display": {
41
- "titleBarBackgroundColor": "#f2f2f2",
42
- "titleBarTextColor": "#414141",
43
- "menu": false,
44
- "menuBarData": {
45
- "menuBar": true
46
- },
47
- "pages": {
48
- "Demo": {
49
- "titleBarText": "示例页"
50
- },
51
- "DemoDetail": {
52
- "titleBarText": "详情页"
53
- }
54
- }
55
- }
56
- }
1
+ {
2
+ "package": "com.application.demo",
3
+ "name": "{{appName}}",
4
+ "versionName": "1.0.0",
5
+ "versionCode": 1,
6
+ "minPlatformVersion": 1070,
7
+ "icon": "/Common/logo.png",
8
+ "deviceTypeList": ["phone"],
9
+ "features": [
10
+ { "name": "system.prompt" },
11
+ { "name": "system.router" },
12
+ { "name": "system.shortcut" }
13
+ ],
14
+ "permissions": [
15
+ { "origin": "*" }
16
+ ],
17
+ "config": {
18
+ "logLevel": "log"
19
+ },
20
+ "router": {
21
+ "entry": "Demo",
22
+ "pages": {
23
+ "Demo": {
24
+ "component": "index"
25
+ },
26
+ "DemoDetail": {
27
+ "component": "index"
28
+ }
29
+ },
30
+ "widgets": {
31
+ "CardDemo": {
32
+ "name": "CardDemo",
33
+ "description": "快应用卡片展示",
34
+ "component": "index",
35
+ "path": "/CardDemo",
36
+ "features": []
37
+ }
38
+ }
39
+ },
40
+ "display": {
41
+ "titleBarBackgroundColor": "#f2f2f2",
42
+ "titleBarTextColor": "#414141",
43
+ "menu": false,
44
+ "menuBarData": {
45
+ "menuBar": true
46
+ },
47
+ "pages": {
48
+ "Demo": {
49
+ "titleBarText": "示例页"
50
+ },
51
+ "DemoDetail": {
52
+ "titleBarText": "详情页"
53
+ }
54
+ }
55
+ }
56
+ }
@@ -1,4 +1,4 @@
1
- {
2
- "doc": "https://doc.quickapp.cn/framework/sitemap.html",
3
- "rules": [{ "rule": "enable", "page": "*" }]
4
- }
1
+ {
2
+ "doc": "https://doc.quickapp.cn/framework/sitemap.html",
3
+ "rules": [{ "rule": "enable", "page": "*" }]
4
+ }
@@ -1,25 +1,25 @@
1
- ## 快速上手
2
-
3
- ### 1. 开发
4
-
5
- ```
6
- npm install
7
- npm run start
8
- ```
9
-
10
- ### 2. 构建
11
-
12
- ```
13
- npm run build
14
- npm run release
15
- ```
16
-
17
- ### 3. 调试
18
-
19
- ```
20
- npm run watch
21
- ```
22
-
23
- ## 了解更多
24
-
25
- 你可以通过我们的[官方文档](https://iot.mi.com/vela/quickapp)熟悉和了解快应用。
1
+ ## 快速上手
2
+
3
+ ### 1. 开发
4
+
5
+ ```
6
+ npm install
7
+ npm run start
8
+ ```
9
+
10
+ ### 2. 构建
11
+
12
+ ```
13
+ npm run build
14
+ npm run release
15
+ ```
16
+
17
+ ### 3. 调试
18
+
19
+ ```
20
+ npm run watch
21
+ ```
22
+
23
+ ## 了解更多
24
+
25
+ 你可以通过我们的[官方文档](https://iot.mi.com/vela/quickapp)熟悉和了解快应用。
@@ -1,5 +1,5 @@
1
- /.nyc_output
2
- /coverage
3
- /node_modules
4
- /dist
1
+ /.nyc_output
2
+ /coverage
3
+ /node_modules
4
+ /dist
5
5
  /build
@@ -1,18 +1,18 @@
1
- {
2
- "name": "{{ appName }}",
3
- "version": "1.0.0",
4
- "description": "",
5
- "engines": {
6
- "node": ">=8.10"
7
- },
8
- "scripts": {
9
- "start": "aiot start --watch",
10
- "build": "aiot build",
11
- "release": "aiot release",
12
- "lint": "eslint --format codeframe --fix --ext .ux,.js src/"
13
- },
14
- "devDependencies": {
15
- "@aiot-toolkit/jsc": "^1.0.3",
16
- "aiot-toolkit": "^{{ toolkitVersion }}"
17
- }
18
- }
1
+ {
2
+ "name": "{{ appName }}",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "engines": {
6
+ "node": ">=8.10"
7
+ },
8
+ "scripts": {
9
+ "start": "aiot start --watch",
10
+ "build": "aiot build",
11
+ "release": "aiot release",
12
+ "lint": "eslint --format codeframe --fix --ext .ux,.js src/"
13
+ },
14
+ "devDependencies": {
15
+ "@aiot-toolkit/jsc": "^1.0.3",
16
+ "aiot-toolkit": "^{{ toolkitVersion }}"
17
+ }
18
+ }
@@ -1,10 +1,10 @@
1
- <script>
2
- export default {
3
- onCreate() {
4
- console.log('app created')
5
- },
6
- onDestroy() {
7
- console.log('app destroyed')
8
- }
9
- }
1
+ <script>
2
+ export default {
3
+ onCreate() {
4
+ console.log('app created')
5
+ },
6
+ onDestroy() {
7
+ console.log('app destroyed')
8
+ }
9
+ }
10
10
  </script>
@@ -1,35 +1,35 @@
1
- {
2
- "package": "com.application.watch.demo",
3
- "name": "{{appName}}",
4
- "versionName": "1.0.0",
5
- "versionCode": 1,
6
- "minPlatformVersion": 1200,
7
- "icon": "/common/logo.png",
8
- "simulationVersion": "default",
9
- "deviceTypeList": [
10
- "watch"
11
- ],
12
- "features": [
13
- {
14
- "name": "system.router"
15
- },
16
- {
17
- "name": "system.configuration"
18
- }
19
- ],
20
- "config": {
21
- "logLevel": "log",
22
- "designWidth": 480
23
- },
24
- "router": {
25
- "entry": "pages/index",
26
- "pages": {
27
- "pages/index": {
28
- "component": "index"
29
- },
30
- "pages/detail": {
31
- "component": "detail"
32
- }
33
- }
34
- }
1
+ {
2
+ "package": "com.application.watch.demo",
3
+ "name": "{{appName}}",
4
+ "versionName": "1.0.0",
5
+ "versionCode": 1,
6
+ "minPlatformVersion": 1200,
7
+ "icon": "/common/logo.png",
8
+ "simulationVersion": "default",
9
+ "deviceTypeList": [
10
+ "watch"
11
+ ],
12
+ "features": [
13
+ {
14
+ "name": "system.router"
15
+ },
16
+ {
17
+ "name": "system.configuration"
18
+ }
19
+ ],
20
+ "config": {
21
+ "logLevel": "log",
22
+ "designWidth": 480
23
+ },
24
+ "router": {
25
+ "entry": "pages/index",
26
+ "pages": {
27
+ "pages/index": {
28
+ "component": "index"
29
+ },
30
+ "pages/detail": {
31
+ "component": "detail"
32
+ }
33
+ }
34
+ }
35
35
  }
@@ -1,26 +1,26 @@
1
- <template>
2
- <div class="demo-page">
3
- <text class="title">{{text}}</text>
4
- </div>
5
- </template>
6
-
7
- <script>
8
- export default {
9
- private: {
10
- text: '欢迎打开详情页'
11
- }
12
- }
13
- </script>
14
-
15
- <style>
16
- .demo-page {
17
- flex-direction: column;
18
- justify-content: center;
19
- align-items: center;
20
- }
21
-
22
- .title {
23
- font-size: 20px;
24
- text-align: center;
25
- }
1
+ <template>
2
+ <div class="demo-page">
3
+ <text class="title">{{text}}</text>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ private: {
10
+ text: '欢迎打开详情页'
11
+ }
12
+ }
13
+ </script>
14
+
15
+ <style>
16
+ .demo-page {
17
+ flex-direction: column;
18
+ justify-content: center;
19
+ align-items: center;
20
+ }
21
+
22
+ .title {
23
+ font-size: 20px;
24
+ text-align: center;
25
+ }
26
26
  </style>
@@ -1,49 +1,49 @@
1
- <template>
2
- <div class="demo-page">
3
- <text class="title">{{$t('a.b')}},欢迎打开{{title}}</text>
4
- <!-- 点击跳转详情页 -->
5
- <input class="btn" type="button" value="跳转到详情页" onclick="routeDetail" />
6
- </div>
7
- </template>
8
-
9
- <script>
10
- import router from '@system.router'
11
- import configuration from '@system.configuration'
12
-
13
- export default {
14
- // 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
15
- private: {
16
- title: '示例页面'
17
- },
18
-
19
- routeDetail() {
20
- // 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
21
- router.push({
22
- uri: '/pages/detail'
23
- })
24
- }
25
- }
26
- </script>
27
-
28
- <style>
29
- .demo-page {
30
- flex-direction: column;
31
- justify-content: center;
32
- align-items: center;
33
- }
34
-
35
- .title {
36
- font-size: 20px;
37
- text-align: center;
38
- }
39
-
40
- .btn {
41
- width: 200px;
42
- height: 40px;
43
- margin-top: 20px;
44
- border-radius: 5px;
45
- background-color: #09ba07;
46
- font-size: 20px;
47
- color: #ffffff;
48
- }
49
- </style>
1
+ <template>
2
+ <div class="demo-page">
3
+ <text class="title">{{$t('a.b')}},欢迎打开{{title}}</text>
4
+ <!-- 点击跳转详情页 -->
5
+ <input class="btn" type="button" value="跳转到详情页" onclick="routeDetail" />
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import router from '@system.router'
11
+ import configuration from '@system.configuration'
12
+
13
+ export default {
14
+ // 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
15
+ private: {
16
+ title: '示例页面'
17
+ },
18
+
19
+ routeDetail() {
20
+ // 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
21
+ router.push({
22
+ uri: '/pages/detail'
23
+ })
24
+ }
25
+ }
26
+ </script>
27
+
28
+ <style>
29
+ .demo-page {
30
+ flex-direction: column;
31
+ justify-content: center;
32
+ align-items: center;
33
+ }
34
+
35
+ .title {
36
+ font-size: 20px;
37
+ text-align: center;
38
+ }
39
+
40
+ .btn {
41
+ width: 200px;
42
+ height: 40px;
43
+ margin-top: 20px;
44
+ border-radius: 5px;
45
+ background-color: #09ba07;
46
+ font-size: 20px;
47
+ color: #ffffff;
48
+ }
49
+ </style>
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _sharedUtils = require("@aiot-toolkit/shared-utils");
8
8
  class Common {
9
- /**
10
- * 遍历项目文件,替换词语
11
- * @param keywords
12
- * @param projectAbsolutePath
9
+ /**
10
+ * 遍历项目文件,替换词语
11
+ * @param keywords
12
+ * @param projectAbsolutePath
13
13
  */
14
14
  static performReplace(keywords, projectAbsolutePath) {
15
15
  const {
@@ -11,8 +11,8 @@ var _path = _interopRequireDefault(require("path"));
11
11
  var _Common = _interopRequireDefault(require("./Common"));
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  const json = require('../template/template.json');
14
- /**
15
- * TemplateUtil
14
+ /**
15
+ * TemplateUtil
16
16
  */
17
17
  class TemplateUtil {
18
18
  static async requestTemplateList(type) {
@@ -27,10 +27,10 @@ class TemplateUtil {
27
27
  return item.demoList;
28
28
  }
29
29
 
30
- /**
31
- * 验证项目名称,只能包含:字母、数字、-、_
32
- * @param value
33
- * @returns
30
+ /**
31
+ * 验证项目名称,只能包含:字母、数字、-、_
32
+ * @param value
33
+ * @returns
34
34
  */
35
35
  static validateProjectName(value) {
36
36
  const reg = /^[0-9a-zA-Z_\u4e00-\u9fa5\-]+$/;
@@ -43,20 +43,20 @@ class TemplateUtil {
43
43
  return true;
44
44
  }
45
45
 
46
- /**
47
- * 创建项目
48
- * @param param
49
- * @param keywords
50
- * @param plugins
51
- * @param cwd
46
+ /**
47
+ * 创建项目
48
+ * @param param
49
+ * @param keywords
50
+ * @param plugins
51
+ * @param cwd
52
52
  */
53
53
  static async createProject(param,
54
- /**
55
- * 要替换的词语
54
+ /**
55
+ * 要替换的词语
56
56
  */
57
57
  keywords, plugins,
58
- /**
59
- * 项目根目录,默认为 process.cwd()
58
+ /**
59
+ * 项目根目录,默认为 process.cwd()
60
60
  */
61
61
  cwd) {
62
62
  const {
@@ -111,8 +111,8 @@ class TemplateUtil {
111
111
  }
112
112
  _sharedUtils.ColorConsole.success(`Create project finish. project path: ${projectAbsolutePath}`);
113
113
  }
114
- /**
115
- * 修改_gitignore为.gitignore
114
+ /**
115
+ * 修改_gitignore为.gitignore
116
116
  */
117
117
  static changeFileName(projectAbsolutePath) {
118
118
  const oldPath = _path.default.join(projectAbsolutePath, '_gitignore');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-aiot",
3
- "version": "2.0.5-widget-provider-beta.2",
3
+ "version": "2.0.6-alpha.0",
4
4
  "description": "An easy way to start aiot project",
5
5
  "main": "lib/index.js",
6
6
  "keywords": [
@@ -23,13 +23,13 @@
23
23
  "test": "node ./__tests__/create-aiot.test.js"
24
24
  },
25
25
  "dependencies": {
26
- "@aiot-toolkit/commander": "2.0.5-widget-provider-beta.2",
27
- "@aiot-toolkit/shared-utils": "2.0.5-widget-provider-beta.2",
26
+ "@aiot-toolkit/commander": "2.0.6-alpha.0",
27
+ "@aiot-toolkit/shared-utils": "2.0.6-alpha.0",
28
28
  "@inquirer/prompts": "^3.0.3",
29
29
  "fs-extra": "^11.2.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/fs-extra": "^11.0.4"
33
33
  },
34
- "gitHead": "4a8894bc66a9c78cd835ed6c1af74d054300e064"
34
+ "gitHead": "d62548a25ca507fac9532e34983e87a8cdee36f5"
35
35
  }