Fix "current value" for <b-select>
element in e.g. edit form views
apparently marking an `<option>` as "selected" does not cut it for Buefy, and we must bind to a v-model somehow. not real crazy about the current method, but it does seem to work okay so far...
This commit is contained in:
parent
1ee76878d9
commit
96c5bd0b69
|
@ -56,7 +56,9 @@
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div tal:condition="use_buefy" tal:omit-tag="">
|
<div tal:condition="use_buefy"
|
||||||
|
tal:define="vmodel vmodel|'field_model_' + name;"
|
||||||
|
tal:omit-tag="">
|
||||||
<b-select tal:attributes="name name;
|
<b-select tal:attributes="name name;
|
||||||
id oid;
|
id oid;
|
||||||
placeholder '(please choose)';
|
placeholder '(please choose)';
|
||||||
|
@ -64,6 +66,7 @@
|
||||||
multiple multiple;
|
multiple multiple;
|
||||||
size size;
|
size size;
|
||||||
style style;
|
style style;
|
||||||
|
v-model vmodel;
|
||||||
@input input_handler;">
|
@input input_handler;">
|
||||||
|
|
||||||
<tal:loop tal:repeat="item values">
|
<tal:loop tal:repeat="item values">
|
||||||
|
|
|
@ -95,6 +95,8 @@
|
||||||
field_model_${field.name}: null,
|
field_model_${field.name}: null,
|
||||||
% elif isinstance(field.schema.typ, deform.FileData):
|
% elif isinstance(field.schema.typ, deform.FileData):
|
||||||
field_model_${field.name}: null,
|
field_model_${field.name}: null,
|
||||||
|
% else:
|
||||||
|
field_model_${field.name}: ${json.dumps(field.cstruct)|n},
|
||||||
% endif
|
% endif
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
|
|
Loading…
Reference in a new issue