我有以下代碼:奧裏利亞選擇初始值
的javascript:
export class App {
values = [
{id: 0, text:'Text 1'},
{id: 1, text:'Text 2'},
{id: 2, text:'Text 3'}
];
obj = {
selected: 2
};
}
HTML:
<template>
<select value.bind="obj.selected">
<option repeat.for="option of values" value="${option.id}">${option.text}</option>
</select>
</template>
的問題是,select
的初始值是不是thirth選項如預期。
我必須做些什麼才能使它正常工作?
@blm - 我不認爲我的問題是,你有聯繫的一個... –