hugo-theme-cyberscopes/layouts/shortcodes/pv/input-textline.html

11 lines
466 B
HTML

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