File tree 10 files changed +119
-1
lines changed
10 files changed +119
-1
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
2
node_modules
3
3
/dist
4
- /template
4
+ # /template
5
5
* .sh
6
6
7
7
# local env files
Original file line number Diff line number Diff line change
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
+ ```
Original file line number Diff line number Diff line change
1
+ {
2
+ "usingComponents" : {}
3
+ }
Original file line number Diff line number Diff line change
1
+ /* * this is <FILENAME> scss */
2
+ .<FILENAME>{
3
+
4
+ }
Original file line number Diff line number Diff line change
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
+ } )
Original file line number Diff line number Diff line change
1
+ <page>
2
+ <view class="<FILENAME>">
3
+
4
+ </view>
5
+ </page>
Original file line number Diff line number Diff line change
1
+ {
2
+ "usingComponents" : {}
3
+ }
Original file line number Diff line number Diff line change
1
+ /* * this is <FILENAME> scss */
2
+ .<FILENAME>{
3
+
4
+ }
Original file line number Diff line number Diff line change
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
+ } )
Original file line number Diff line number Diff line change
1
+ <page>
2
+ <view class="<FILENAME>">
3
+
4
+ </view>
5
+ </page>
You can’t perform that action at this time.
0 commit comments