Scala / Lift:CSS 选择器转换和 DispatchSnippet
是否可以将 Lift 的 CSS 选择器转换与 DispatchSnippet 一起使用?它似乎对我不起作用。
Is it possible to use Lift's CSS Selector Transforms together with DispatchSnippet? It does not seem to work for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答我自己的问题...是的,这是可能的!我的问题如下:代码片段方法必须是 NodeSeq => 类型NodeSeq 但 CSS 转换返回 () => CSSSel。 CSSSel 本身就是 NodeSeq => NodeSeq,所以CSS Transformation是() => (NodeSeq => NodeSeq)。
这意味着,为了将它与 DispatchSnippet 一起使用,必须在调度程序中像这样引用它:
基本上,我只是在末尾有一个额外的 _ 符号。
Answering my own question... yeah, it is possible! My problem was the following: Snippet methods have to be of the type NodeSeq => NodeSeq but CSS Transformations return a () => CSSSel. A CSSSel is itself NodeSeq => NodeSeq, so the CSS Transformation is () => (NodeSeq => NodeSeq).
That means, in order to use it with DispatchSnippet it must be referenced like this in the dispatcher:
Basically, I just had an extra _ sign at the end.