聚合物和榆树的不一致

聚合物和榆树的不一致,第1张

概述鉴于: swiper = div [] [ node "swiper-node" [ class "block" ] [ div [ id "swiperContainer" ] [ div [ class "swiper-wrapper" ] 鉴于:

swiper =     div []         [ node "swiper-node"             [ class "block" ]             [ div [ ID "swiperContainer" ]                 [ div [ class "swiper-wrapper" ]                     [ div [ class "swiper-slIDe",style [ ( "height","400px" ),( "background","gray" ) ] ] [ text "slIDe1" ],div [ class "swiper-slIDe","gray" ) ] ] [ text "slIDe2" ],"gray" ) ] ] [ text "slIDe3" ],"gray" ) ] ] [ text "slIDe4" ]                     ]                 ]             ]         ]
<dom-module ID="swiper-node">   <template></template>   <style>   </style>   <script>     (function () {       polymer({         is: 'swiper-node',});     }());   </script></dom-module>

呈现的HTML是:

注意空的swiper-node.

有趣的是,当应用程序启动并且swiper在Elm dom中时会发生这种情况.

但是,如果

>应用程序启动
>并且狙击手不在榆树
> AND在某些用户事件中,swiper被添加到elm dom中

它正确呈现.

经过this thread之后,我做了相同的配置:

window.polymer = {   dom: 'shadow',lazyRegister: true };

在这两种情况下:

>当应用程序以swiper开始时
>稍后在用户事件中添加swiper(单击)

这是渲染的HTML:

虽然我们达到了一致性,但是swiper-node没有被渲染.你知道当你在检查器中悬停一个dom元素时,它会在渲染窗口中突出显示吗?好吧,徘徊在任何一个swiper-node孩子身上,什么都没有.

我只使用polymer抽象/组件,所以我可以很好地利用Elm中的Js库.因此,不要假设我的聚合物或网络组件知识很好.

解决方法 只需在模板中添加内容,以便组件变为:

<dom-module ID="swiper-node">   <template><content></content></template>   <style>   </style>   <script>     (function () {       polymer({         is: 'swiper-node',});     }());   </script></dom-module>

:: curl_up_and_cry ::

总结

以上是内存溢出为你收集整理的聚合物和榆树的不一致全部内容,希望文章能够帮你解决聚合物和榆树的不一致所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1053254.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存