Ich bin eine Reihe von Radio-Buttons in Aurelia mit dem Code wie folgt zu erstellen:Aurelia Repeater: model.bind arbeitet nicht für Radiobuttons
<div repeat.for="option of options">
<input type="radio" id="${option}_id" name="radio_options" model.bind="option" checked.bind="optionValue"/>
<label for="${option}_id" id="${option}_label">${option}</label>
</div>
jedoch es auf diese Weise tun, entdeckte ich, dass model.bind funktioniert nicht - der optionValue in der entsprechenden Klasse ist nicht ausgefüllt, wenn das Optionsfeld aktiviert ist. Wenn ein Wert in der Klasse optionValue zugewiesen ist, wird das entsprechende Optionsfeld nicht aktiviert. Ich fand das nur mit Repeater. Optionen sind in meinem Fall Zahlen. Könnten Sie mir bitte helfen, herauszufinden, was hier falsch ist?
Sie tun: 'id = "$ {Option} _id"' und 'model.bind = "Option"' . Ist Modell ein Objekt oder ein String? Sollte es nicht nur "value.bind =" option "' sein? –
In meinem Fall ist "Option" die Nummer, wie ich gesagt habe (ich habe this.options = 9 in meiner Aurelia-Klasse). Ich habe value.bind = "option" ausprobiert, aber es hat auch nicht geholfen. – sleb82