有另一个组件目录(模板和java文件)
我有一个关于 Tapestry 组件编程的问题。我们可以用另一个 Component 文件夹来代替原来的文件夹吗?
如果您的回答是肯定的,您如何声明它(在 AppModule 文件中...)?
谢谢
I have a question about Tapestry Component Programming. Can we have an another Component folder instead of the original one ?
If your reply is yes, How can you declare it (in the AppModule file ...) ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以创建组件包的子包:.components.menu,然后使用 或 ,例如。拥有多个根组件包是一种我真的看不出它有什么好处的东西。如果您确实想这样做,您可以在应用程序中声明一个新的组件库。 这里是文档。
You can create subpackages of the components package: .components.menu and then use or , for example. Having more than one root components package is something which I really can't see a good use for it. If you really want to do that, you can declare a new component library inside your application. Here's the documentation.
您可以实现并贡献自己的
ComponentTemplateLocator
阅读此内容
you can implement and contribute your own
ComponentTemplateLocator
read this
如果您需要这种级别的分离并且无法通过子包获得它,那么您最好创建一个单独的组件库作为单独的项目。这将为您带来一些优势:
也就是说,如果您绝对需要将组件放在不同的包中,请参阅 pstanton 的答案。
If you need this level of separation and you can't get it with subpackages, you may be better of creating a separate component library as a separate project. This would give you a few advantages:
That said, if you absolutely need to have components in a different package, see pstanton's answer.