Skip to content

[2.0]Vue.set doesn't support sparse array #3942

@jiangfengming

Description

@jiangfengming

jsFiddle: http://jsfiddle.net/fenivana/xr63gj2x/

const a = [];
Vue.set(a, 10, 'foo');
console.log(a); // ['foo']
alert(a.length); // 1
alert(a[10]); // undefined
alert(a[0]); // 'foo'

Expected a would be [ undefined x 10, 'foo'], bug got ['foo'] instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions