trying to conceive more complex situations (e.g. a table)
This commit is contained in:
parent
75ba831e01
commit
97b0629de0
3 changed files with 19 additions and 3 deletions
|
@ -1,10 +1,10 @@
|
|||
---
|
||||
title: "example"
|
||||
summary: ""
|
||||
summary: "Test Page #1"
|
||||
img:
|
||||
pageid: test1
|
||||
domains: []
|
||||
topics: []
|
||||
domains: [App]
|
||||
topics: [Examples]
|
||||
date: 2023-03-01
|
||||
author: helmutm
|
||||
draft: false
|
||||
|
@ -20,4 +20,6 @@ cyberscopes example site - use petite-vue in Hugo-generated sites.
|
|||
|
||||
{{< pv/display expr="`${data.firstname} ${data.lastname}`.trim() || '???'" >}}
|
||||
|
||||
{{< pv/display name="email" >}}
|
||||
|
||||
{{< pv/debug >}}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
{{- $name := .Get "name" | default "textline" -}}
|
||||
{{- $expr := .Get "expr" | default (printf "data.%s" $name) -}}
|
||||
{{- $default := .Get "default" | default "" -}}
|
||||
{{- $tcells := (and .Parent .Parent.Get "tcells") | default false -}}
|
||||
{{- if $tcells }}<td>{{ end -}}
|
||||
<div v-scope>
|
||||
<pre v-text="{{ $expr }}"></pre>
|
||||
</div>
|
||||
{{- if $tcells }}</td>{{ end -}}
|
||||
|
||||
|
|
11
layouts/shortcodes/pv/table.html
Normal file
11
layouts/shortcodes/pv/table.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
{{- $name := .Get "name" | default "table" -}}
|
||||
{{- $tcells := true -}}
|
||||
<table>
|
||||
<template id="{{ $name }}">
|
||||
{{ .Inner }}
|
||||
</template>
|
||||
<tr v-for="row of data[{{ $name }}]">
|
||||
<div v-scope="Row({{ $name }}, row)"/>
|
||||
</tr>
|
||||
</table>
|
||||
|
Loading…
Add table
Reference in a new issue