Picturefill in IE11 with Vue.js



在IE11中,图片填充库不适用于vue.js。我得到以下警告:

[Vue warn]: Unknown custom element: <picture> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

我可以使用Vue.config.ignoredElements = ['picture']删除警告,但这似乎无法解决问题。我认为在hood vue.js下正在使用图片标签进行操作,因为它不会被IE11识别,因此vue.js认为它是一个自定义标签?

请让我知道如何解决此问题!谢谢

对于IE11,您必须在DOM中加载图片标签后进行摄影函数调用。它会动态地将SRC属性添加到IMG标签中。

//For IE 11 Fix
    if(typeof picturefill === "function") {
      picturefill();
    }

最新更新