mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Add template type column to Attribute View https://github.com/siyuan-note/siyuan/issues/8766
This commit is contained in:
parent
7d1e1bf2e5
commit
0aa61fe5b7
3 changed files with 18 additions and 17 deletions
|
|
@ -232,7 +232,7 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
|||
}
|
||||
|
||||
// 渲染模板列
|
||||
if av.KeyTypeTemplate == tableCell.ValueType && nil != tableCell.Value && nil != tableCell.Value.Template {
|
||||
if av.KeyTypeTemplate == tableCell.ValueType {
|
||||
render := func(blockID string) string {
|
||||
funcMap := sprig.TxtFuncMap()
|
||||
goTpl := template.New("").Delims(".action{", "}")
|
||||
|
|
@ -250,6 +250,7 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
|
|||
return buf.String()
|
||||
}
|
||||
|
||||
tableCell.Value = &av.Value{ID: tableCell.ID, KeyID: col.ID, BlockID: rowID, Type: av.KeyTypeTemplate, Template: &av.ValueTemplate{}}
|
||||
tableCell.Value.Template.Render(tableCell.Value.BlockID, render)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue