微信小程序引入绝对路径

微信小程序引入绝对路径

方法1

app.jsApp({require:function($uri){returnrequire($uri)}, onLaunch:function(){},)}page.jsconst app = getApp();const echarts = app.require(/ec-canvas/echarts)Page({ data:{}, onLoad:function(options){},)}

方法2

app.json{“resolveAlias”:{“~/*”:“/*”},“pages”:[“pages/index/index”],}index.jsimport*asecharts搭建源码点我wcqh.cnfrom~/ec-canvas/echarts;Page({ data:{}, onLoad:function(options){},)}
作者最新博文
2022-09-06 23:07:01

© 版权声明
THE END
喜欢就支持一下吧
点赞824 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容