我一直在使用聚合物構建幻燈片自定義元素,並且已經使用Animate.css庫進行幻燈片切換。當Canary啓用「實驗性網絡平臺」功能時,標籤會按預期工作,但在關閉實驗功能的常規鉻版中,平臺填充不允許我在樣式標籤中進行數據綁定。舉個例子:爲什麼聚合物中的數據綁定聚合填充不能在<style>標籤中工作?
<polymer-element name="impress-slide" constructor="ImpressSlide" attributes="exit entrance">
<template>
<link rel="stylesheet" type="text/css" href="basic-animations.css">
<style type="text/css">
:host{
position: relative;
top: 0;
left: 0;
overflow: hidden;
display: none;
width: 100%;
height: 100%;
margin: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
/* Animate.css */
-webkit-animation: 1s both;
animation: 1s both;
-webkit-animation-name: {{ animation }} !important;
animation-name: {{ animation }} !important;
}
@-webkit-keyframes fadeOutRightBig {
0% {
opacity: 1;
-webkit-transform: translateX(0);
transform: translateX(0);
}
100% {
opacity: 0;
-webkit-transform: translateX(2000px);
transform: translateX(2000px);
}
}
@keyframes fadeOutRightBig {
0% {
opacity: 1;
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
100% {
opacity: 0;
-webkit-transform: translateX(2000px);
-ms-transform: translateX(2000px);
transform: translateX(2000px);
}
}
@keyframes bounceIn {
0% {
opacity: 0;
-webkit-transform: scale(.3);
-ms-transform: scale(.3);
transform: scale(.3);
}
50% {
opacity: 1;
-webkit-transform: scale(1.05);
-ms-transform: scale(1.05);
transform: scale(1.05);
}
70% {
-webkit-transform: scale(.9);
-ms-transform: scale(.9);
transform: scale(.9);
}
100% {
-webkit-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
}
:host(.past:host) {
/*opacity: 0;*/
}
:host(.current:host) {
display: block;
}
:host(.next:host) {
pointer-events: none;
}
</style>
<content></content>
</template>
<script type="text/javascript">
(function() {
Polymer('impress-slide', {
entrance: 'bounceIn',
exit: 'fadeOutRightBig',
animation: "",
animateIn: function() {
// this.opacity = 1;
this.animation = this.entrance;
},
animateOut: function() {
// this.opacity = 0;
this.animation = this.exit;
},
ready: function() {
}
})
})();
</script>
</polymer-element>
的animation-name: {{ animation }} !important;
將在填充工具的版本仍然未渲染,簡單地計算到animation: 1s both;
。我想知道是否有人對此有何洞見,以及我可以做什麼作爲解決方法?
數據綁定現在可在Chrome(only)中的