简体   繁体   English

aurelia 1.0中的可更换属性是否已过时?

[英]Is replaceable attribute obsolete in aurelia 1.0?

我的印象是slot取代了replaceable ,但我被告知replaceable是在1.0版本中重新引入的,是真的吗?

replaceable still exists due to a use-case that isn't covered by slots in the Shadow DOM v1 spec: 由于Shadow DOM v1规范中的插槽未涵盖的用例, replaceable仍然存在:

The new Shadow DOM v1 spec has support for slot "fallback content". 新的Shadow DOM v1规范支持插槽“后备内容”。 As a result, our replaceable attribute is no longer needed and has been removed in favor of slot fallbacks. 因此,不再需要我们的replaceable属性,并且已删除该属性以支持插槽回退。 However, slots do not solve the problem of replacing a template that is used by a repeat , if or other template controller. 但是,插槽不能解决替换repeatif或其他模板控制器使用的模板的问题。 So, we still support placing the part attribute on a template controller's element and overriding it by using replace-part in the element's content. 因此,我们仍然支持将part属性放在模板控制器的元素上,并通过在元素的内容中使用replace-part来覆盖它。

http://blog.durandal.io/2016/06/08/getting-prepared-for-aurelia-1-0-0-rc/ http://blog.durandal.io/2016/06/08/getting-prepared-for-aurelia-1-0-0-rc/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM