惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

博客园 - 折翼的飞鸟

React中 state值根据props传入值变化的静态方法 getDerivedStateFromProps 微信小程序分享图片显示自定义内容 Taro4.x 引入 taro-ui 组件库 Taro4.x引入redux报错:TypeError: middleware is not a function uniapp+vue3 微信小程序使用mqtt通信 uniapp+vue3 在App.vue中如何设置全局调用方法 Taro 在页面中import包、组件、样式文件的顺序自定义规则 Taro优化VirtualList虚拟列表组件 Taro 引入moment.js打包过大 Taro 打包体积分析 React:消息订阅(subscribe)-发布(publish)机制 Taro: chooseLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json/ext.json Taro 支付宝小程序Page页获取小程序启动时的参数 Taro 主包vendors.js文件过大 Taro自定义Tabbar Taro 微信转支付宝小程序: 问题八 TypeError: Function(...) is not a function Taro微信转支付宝小程序:问题七 引入的文件图片文件名不能有@符号 Taro微信转支付宝小程序:问题六 同时编译微信小程序和支付宝小程序 Taro微信转支付宝小程序:问题五 编译时没有报错,工具中却莫名奇妙的错误提示
Taro 插件引入
折翼的飞鸟 · 2022-12-17 · via 博客园 - 折翼的飞鸟

Taro使用版本3.1

  Taro的文档中只有静态引入插件,动态引入好像会有问题,而且官方已经找不到动态引入的文档。

    微信、支付宝小程序中使用插件:

  1、app.json配置

  plugins: {
    "thePlugin": {
      "version": "*", // 目前只支持设置 * 拉取当前上架最新版本
      "provider": "20************80"  // 请确认写入准确的插件appid
    }
  },

   

  2、对应页面引入插件,例如页面index.jsx, 在index.config.js中引入对应插件信息

  usingComponents: {
    "float-modal": "plugin://xxxxxxx/xxxxxx" //请确认路径与app.json中的名称一致
  }

 

   3、在页面中引用插件

   <float-modal shopId={config.initConfig} />

 

微信小程序支持分包中引入插件,就是要在分包下引入插件

     

 注意: Taro中不支持动态引入插件,之前在编译支付宝小程序时,插件一直都没有效果

      let me = this;
    Taro.loadPlugin({ plugin:
'20xxxxxxxxxxxx80@*', // 指定要加载的插件 ID 和版本号,为 * 时自动选择版本 success: () => { me.setState({isReadyPlugin: true}); // 插件已加载,可以渲染插件组件了 }, fail: (err) => { console.log(err) } });