小说阅读器插件链接:插件介绍文档
该如何使用呢?在 menifest.json 中配置了:
    /* 小程序特有相关 */  
    "mp-weixin": {  
        "appid": "xxxxxxxxxxxxxxxxxxxxxx",  
        "setting": {  
            "urlCheck": false,  
            "minified": true  
        },  
        "usingComponents": true,  
        "plugins": {  
            "novel-plugin": {  
                "version": "latest",  
                "provider": "wx293c4b6097a8a4d0"  
            }  
        }  
    },在页面 vue 代码中配置:
    onLoad() {  
        const novelPlugin = uni.requireNativePlugin('novel-plugin')  
        console.log(111, novelPlugin)  
        if (novelPlugin) {  
            novelPlugin.onPageLoad(this.onNovelPluginLoad)  
        }  
    },发现会报错
TypeError: common_vendor.index.requireNativePlugin is not a function  
    at Proxy.onLoad (bookIntro.vue:123)  
    at callWithErrorHandling (vue.runtime.esm.js:1356)  
    at callWithAsyncErrorHandling (vue.runtime.esm.js:1363)  
    at Array.hook.__weh.hook.__weh (vue.runtime.esm.js:2461)  
    at invokeArrayFns (uni-shared.es.js:441)  
    at Proxy.callHook (uni.mp.esm.js:206)  
    at li.methods.onLoad (uni.mp.esm.js:792)  
    at li.<anonymous> (VM2937 WASubContext.js:1)  
    at li.c.__callPageLifeTime__ (VM2937 WASubContext.js:1)  
    at VM2937 WASubContext.js:1(env: Windows,mp,1.06.2504030; lib: 3.9.2) 
             
             
             
			 
                                        
                                     
            
1***@qq.com
具体怎么使用的,能不能贴出来,方便后来人,谢谢!
2025-10-12 21:11