如果页面引用了组件,那么就可以使用这个API:
js:
onLoad: function(e) {
var ctx = this;
ctx.selectComponent && null == ctx.notification && (ctx.notification = ctx.selectComponent("#notification"));
......
wxml:
<dialog id="notification" bindonConfirm="onConfirm"></dialog>
json:
{
"usingComponents": {
"dialog": "/utils/Dialog/Dialog"
}
}
网友评论