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>
|
||||
</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;
|
||||
id oid;
|
||||
placeholder '(please choose)';
|
||||
|
@ -64,6 +66,7 @@
|
|||
multiple multiple;
|
||||
size size;
|
||||
style style;
|
||||
v-model vmodel;
|
||||
@input input_handler;">
|
||||
|
||||
<tal:loop tal:repeat="item values">
|
||||
|
|
|
@ -95,6 +95,8 @@
|
|||
field_model_${field.name}: null,
|
||||
% elif isinstance(field.schema.typ, deform.FileData):
|
||||
field_model_${field.name}: null,
|
||||
% else:
|
||||
field_model_${field.name}: ${json.dumps(field.cstruct)|n},
|
||||
% endif
|
||||
% endif
|
||||
% endfor
|
||||
|
|
Loading…
Reference in a new issue