add components

This commit is contained in:
dntzhang 2018-11-08 15:47:07 +08:00
parent e6c12ea3eb
commit 0a1b21ae64
12 changed files with 71 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import './utils/mp'
import './assets/index.css'
import './mp/app'
//import store from './store/app-store'
//[todo] set document.title
route('*', p => {
const ele = document
.querySelector('#root')

View File

@ -0,0 +1,23 @@
// components/my-child/my-child.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,2 @@
<!--components/my-child/my-child.wxml-->
<text>my-child</text>

View File

@ -0,0 +1 @@
/* components/my-child/my-child.wxss */

View File

@ -0,0 +1,23 @@
// components/my-ele/my-ele.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"my-child":"../my-child/my-child"
}
}

View File

@ -0,0 +1,4 @@
<view>
<my-child />
<view>my-ele</view>
</view>

View File

@ -0,0 +1 @@
/* components/my-ele/my-ele.wxss */

View File

@ -0,0 +1 @@
{}

View File

@ -1,3 +1,6 @@
{
"navigationBarTitleText": "查看启动日志"
"navigationBarTitleText": "查看启动日志",
"usingComponents": {
"my-ele":"../../components/my-ele/my-ele"
}
}

View File

@ -3,4 +3,5 @@
<block wx:for="{{logs}}" wx:for-item="log">
<text class="log-item">{{index + 1}}. {{log}}</text>
</block>
<my-ele />
</view>