支付宝小程序很多API需要用到 基础库2.X
比如Taro.onPageNotFound
,在 Taro 3.3.5
构建后支付宝小程序环境内直接报错:TypeError: _tarojs_taro__WEBPACK_IMPORTED_MODULE_4___default.a.onPageNotFound is not a function
;
因为支付宝小程序 该API介绍需要 基础库 2.7.2 或更高版本
目前的问题是,按照支付宝小程序基础库2.x
启用文档,勾选【启用小程序基础库 2.0 构建】后编译报错:
Failed to compile
Module build failed (from C:/snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-thread-loader/lib/cjs.js):
Thread Loader (Worker 0)
slot 的祖先节点中未找到 element
at (d:\xxx\dist\alipay\base.axml:319:8)
317:
318: <template name="tmpl_0_slot">
319: <view slot="{{i.name}}" id="{{i.uid}}">
^
320: <block a:for="{{i.cn}}" a:key="uid">
321: <template is="{{xs.e(0)}}" data="{{i:item}}" />
at (d:\xxx\dist\alipay\base.axml:319:8)
Module build failed (from C:/snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-thread-loader/lib/cjs.js):
Thread Loader (Worker 0)
slot 的祖先节点中未找到 element
at (d:\xxx\dist\alipay\pages-qr\pages\qrBarCode\qrBarCode.axml:321:8)
319:
320: <template name="tmpl_0_slot">
321: <view slot="{{i.name}}" id="{{i.uid}}">
^
322: <block a:for="{{i.cn}}" a:key="uid">
323: <template is="{{xs.e(0)}}" data="{{i:item}}" />
at (d:\xxx\dist\alipay\pages-qr\pages\qrBarCode\qrBarCode.axml:321:8)
Module build failed (from C:/snapshot/code-repo/out/target/bundle/node_modules/@ali/antcube-thread-loader/lib/cjs.js):
Thread Loader (Worker 0)
slot 的祖先节点中未找到 element
at (d:\xxx\dist\alipay\pages\citySwitch\index.axml:321:8)
319:
320: <template name="tmpl_0_slot">
321: <view slot="{{i.name}}" id="{{i.uid}}">
^
322: <block a:for="{{i.cn}}" a:key="uid">
323: <template is="{{xs.e(0)}}" data="{{i:item}}" />
at
这个 API 长什么样?
支持在支付宝小程序内勾选 【启用小程序基础库 2.0 构建】