if ('paintWorklet' in CSS) {
CSS.paintWorklet.addModule('mystuff.js');
}
- 而在CSS通过@supports来做相应的检测:
@supports (background: paint(id)) {
body {
background-image: paint(checkerboard);
}
}
- 原文: https://www.w3cplus.com/css/css-paint-api.html © w3cplus.com