gpt4 book ai didi

ember.js - 如何使用 Ember CLI 在两个组件之间共享模板?

转载 作者:行者123 更新时间:2023-12-03 22:21:49 26 4
gpt4 key购买 nike

我有两个组件:SpecialButtonComponentSpecialButtonDerivativeComponent

SpecialButton 组件自动使用位于 /app/templates/components/special-button.hbs 的模板。

我希望 SpecialButtonDerivativeComponent 使用相同的模板,但到目前为止我还没有成功尝试使用此技术:

// app/components/special-button-derivative.js
import SpecialButtonComponent from './special-button';

export default SpecialButtonComponent.extend({
templateName: 'components/special-button'
});

我也尝试过使用 layoutName 而不是 templateName,但仍然没有成功。有什么想法吗?

最佳答案

组件没有templateName

我会尝试将 layout 设置为 null,然后指定一个 layoutName

关于ember.js - 如何使用 Ember CLI 在两个组件之间共享模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27449968/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com