Add `Link` support
This commit is contained in:
parent
4e8b84e4a1
commit
928827f961
|
@ -26,3 +26,17 @@ extension Link: _HTMLPrimitive {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
@_spi(TokamakStaticHTML)
|
||||
extension Link: HTMLConvertible {
|
||||
public var tag: String { "a" }
|
||||
public func attributes(useDynamicLayout: Bool) -> [HTMLAttribute: String] {
|
||||
["href": _LinkProxy(self).destination.absoluteString, "class": "_tokamak-link"]
|
||||
}
|
||||
|
||||
public func primitiveVisitor<V>(useDynamicLayout: Bool) -> ((V) -> ())? where V: ViewVisitor {
|
||||
{
|
||||
$0.visit(_LinkProxy(self).label)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue