Skip to content

Commit 60ee926

Browse files
committed
添加readme
1 parent 515860a commit 60ee926

File tree

10 files changed

+119
-1
lines changed

10 files changed

+119
-1
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DS_Store
22
node_modules
33
/dist
4-
/template
4+
#/template
55
*.sh
66

77
# local env files

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Miniprogram-Typescript
2+
3+
### 简介
4+
一款基于Typescript语言开发的微信小程序模板,使用gulp基于流构建,样式使用scss模块化开发,主要用来迁移样式,让我们方便快速的开发小程序
5+
6+
### 主要技术
7+
* Typescript
8+
* sass
9+
* gulp
10+
* uglify
11+
12+
### 使用
13+
14+
开发模式:
15+
16+
```sh
17+
git clone git@github.com:xpioneer/miniprogram-typescript.git
18+
cd miniprogram-typescript
19+
yarn
20+
yarn start
21+
```
22+
23+
### 自动生成模块文件
24+
25+
```sh
26+
#使用命令:
27+
yarn gen:page login
28+
29+
#可以生成src/pages/目录下的login文件夹,并且初始化小程序的四个文件
30+
```
31+
32+
### 构建
33+
34+
```sh
35+
yarn build
36+
```

template/components/index.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"usingComponents": {}
3+
}

template/components/index.scss

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** this is <FILENAME> scss */
2+
.<FILENAME>{
3+
4+
}

template/components/index.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//<FILENAME>.ts
2+
//获取应用实例
3+
import { IMyApp } from '@/app'
4+
5+
const app = getApp<IMyApp>()
6+
7+
Page({
8+
data: {
9+
// page data
10+
},
11+
//事件处理函数
12+
yourTap() {
13+
//
14+
},
15+
16+
// miniapp LifeCycle
17+
onLoad() {
18+
//
19+
},
20+
onShow() {
21+
//
22+
},
23+
onHide() {
24+
//
25+
},
26+
onUnload() {
27+
//
28+
}
29+
})

template/components/index.wxml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<page>
2+
<view class="<FILENAME>">
3+
4+
</view>
5+
</page>

template/pages/index.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"usingComponents": {}
3+
}

template/pages/index.scss

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** this is <FILENAME> scss */
2+
.<FILENAME>{
3+
4+
}

template/pages/index.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//<FILENAME>.ts
2+
//获取应用实例
3+
import { IMyApp } from '@/app'
4+
5+
const app = getApp<IMyApp>()
6+
7+
Page({
8+
data: {
9+
// page data
10+
},
11+
//事件处理函数
12+
yourTap() {
13+
//
14+
},
15+
16+
// miniapp LifeCycle
17+
onLoad() {
18+
//
19+
},
20+
onShow() {
21+
//
22+
},
23+
onHide() {
24+
//
25+
},
26+
onUnload() {
27+
//
28+
}
29+
})

template/pages/index.wxml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<page>
2+
<view class="<FILENAME>">
3+
4+
</view>
5+
</page>

0 commit comments

Comments
 (0)