Skip to content

原来有value时,一次update中既改变了_list又改变了value,会有同时选中两项的可能 #4

@z-ZYS-s

Description

@z-ZYS-s

可以通过使用时避免,不过看能不能fix掉。

<listView value={value}>
    {#list list as item}
    <item value={item.id}>{item.course}</item>
    {/list}
</listView>
<button on-click={this.getList()}>getList</button>
{value}
let component = new RGUI.Component({
    template,
    data: {
        value: 2,
        list: []
    },
    getList() {
        this.data.value = 5;
        this.data.list = [
            {id: 2, course: 'Test1'},
            {id: 5, course: 'Test2'},
            {id: 6, course: 'Test3'},
        ]
    }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions