聚合物元素的属性可以定义为attributes="toggle-foo"
,在聚合物定义中默认为 ,'toggle-foo':false
并在聚合物定义中的其他地方使用,例如if( this['toggle-foo'] ){...}
。如何在模板中使用带连字符的属性名称?
我尝试了以下方法:
<template if="{{toggle-foo}}">
<template if="{{this['toggle-foo']}}">
<template if="{{'toggle-foo'}}">