59

html2image原理简述

 6 years ago
source link: https://juejin.im/post/5a9de7eff265da238c3a2bbe
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言 看到 TJ 大神 star了dom-to-image,也一直很好奇html怎么转 image 那么就翻下源码,看下是如何实现的,其实一共就不到800行代码,还蛮容易读懂的 工作原理 使用svg的一个特性,允许在<foreignobject>标

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK