diff --git a/exampleSite/content/app/test1.md b/exampleSite/content/app/test1.md index ba93480..ce07321 100644 --- a/exampleSite/content/app/test1.md +++ b/exampleSite/content/app/test1.md @@ -17,4 +17,4 @@ cyberscopes example site - use petite-vue in Hugo-generated sites. {{< pv/input-textline name="firstname" >}} {{< pv/input-textline name="lastname" >}} -{{< pv/display name="firstname" >}} +{{< pv/display expr="`${data.firstname} ${data.lastname}`" >}} diff --git a/layouts/shortcodes/pv/display.html b/layouts/shortcodes/pv/display.html index da508a5..93ecef6 100644 --- a/layouts/shortcodes/pv/display.html +++ b/layouts/shortcodes/pv/display.html @@ -1,5 +1,6 @@ +{{- $expr := .Get "expr" | default "data" -}}
-

+  

 
diff --git a/layouts/shortcodes/pv/input-textline.html b/layouts/shortcodes/pv/input-textline.html index 0fa3cf5..470e4ef 100644 --- a/layouts/shortcodes/pv/input-textline.html +++ b/layouts/shortcodes/pv/input-textline.html @@ -1,7 +1,7 @@ {{- $name := default "textline" (.Get "name") }}
+ v-model="data.{{ $name }}" + @vue:mounted="data.{{ $name }} = ''" + @change="save()" />