收藏
回答

wepy开发插件


wepy开发小程序插件,miniprogram内使用原生,plugin功能使用wepy,报错如下:
插件配置( 编译后路径 /plugin/plugin.json ):

{
"publicComponents": {
"promotionindex": "pages/promotions/promotion"
 },
"main": "index.js"
}

插件代码 ( 编译后路径 /plugin/pages/promotions/promotion ):
小程序配置插件(编译后路径 /miniprogram/app.json):

{
"pages": [
"pages/index/index"
 ],
"plugins": {
"myPlugin": {
"version": "dev",
"provider": "xxxxxxxxxxxxxxxxxxx"
   }
}
}

模块调用插件配置( 编译后路径  /miniprogram/pages/index/index.json):

{
"usingComponents": {
"promotion": "plugin://myPlugin/promotionindex"
 }
}


project.config.json:

{
"description": "A WePY project",
"setting": {
"urlCheck": true,
"es6": false,
"postcss": false,
"minified": false,
"newFeature": true
  },
"compileType": "plugin",
"appid": "xxxxxxxxxxxxxx",
"projectname": "mpp-plugin",
"miniprogramRoot": "./miniprogram",
"pluginRoot": "./plugin",
"condition": {}
}


最后一次编辑于  2018-06-29
回答关注问题邀请回答
收藏

1 个回答

  • tony
    tony
    2018-07-18

    你的插件内有些小程序插件不支持的API你是怎么调用的

    2018-07-18
    赞同
    回复