先创建一个这样的路径
然后在indexbottom的json中写入
{
"component": true,
"usingComponents": {}
}
在需要引入自定义控件的index.json中写入
{
"usingComponents": {
"indexbottom": "../components/index/indexbottom/indexbottom"
}
}
然后就可以直接在页面上调用
<indexbottom></indexbottom>
自定义控件js
Component({
/**
* 组件的属性列表
*/
properties: {},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的onLoad事件
* /
ready(){},
/**
* 组件的方法列表
*/
methods: {},
})