前端还是有不少实现的开源项目,但适合小程序的暂时没有找到
以下链接前端可实现DM码显示:
Datamatrix generator
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5ibvNWa2FmZvw1Z2NXL4lmc0FWbhRXYk9CXv1WZk9CXvlmLiVHa0l2Zuc2bsFGdhR2Lc9CX6MHc0RHaiojIsJye.png)
https://datalog.github.io/demo/datamatrix-svg/
GitHub - metafloor/bwip-js: Barcode Writer in Pure JavaScriptBarcode Writer in Pure JavaScript. Contribute to metafloor/bwip-js development by creating an account on GitHub.
https://github.com/metafloor/bwip-jsbwip-js 用纯js来实现的,实现了很多种条码
前端可通过操作document操作,小程序屏蔽了document操作,bwip-js包的大小800KB且个人需求仅需要dm码,通过抽取bwip-js便可实现dm码显示
GitHub - 1814356580/datamatrix
https://github.com/1814356580/datamatrix
用法参考bwip-js