gpt4 book ai didi

Swift vapor 3 ViewRenderer 错误

转载 作者:可可西里 更新时间:2023-11-01 00:20:26 26 4
gpt4 key购买 nike

错了

Please choose which ViewRenderer you prefer, multiple are available: PlaintextRenderer, LeafRenderer.

这是我在 configure.swift

中的代码
try services.register(LeafProvider())
config.prefer(LeafRenderer.self, for: TemplateRenderer.self)

叶子添加到 Package.swift

.target(name: "App", dependencies: ["Vapor", "FluentSQLite", "Crypto", "Leaf"]),

虽然我也做了 vapor xcodeBuildRun ,但它仍然拒绝工作。

最佳答案

// As of Vapor 3.0.1 and Leaf 3.0.0-rc.2.2
config.prefer(LeafRenderer.self, for: ViewRenderer.self)

关于Swift vapor 3 ViewRenderer 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50190421/

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