hugo-theme-cyberscopes/layouts/shortcodes/pv/data-field-line.html

13 lines
486 B
HTML

{{- $type := .Get "type" | default "text" -}}
{{- $name := .Get "name" | default "textline" -}}
<div>
<input type="{{ $type }}" name="{{ $name }}"
{{- with .Get "attrs" }} {{ . }}{{ end }}
:readonly="hasmode('view') || meta['{{ $name }}'].readonly ? '' : null"
v-model="data.{{ $name }}"
@vue:mounted="initField('{{ $name }}', {
type: '{{ $type }}',
default: '{{ .Get "default" }}'
})"
{{- with .Get "onchange" }} @change="{{ . }}"{{ end }} />
</div>