let var 的話是肯定不可以在 class 內用的了,如果想定義變量的話可以在 babel 加上這個插件
https://babeljs.io/docs/plugins/transform-class-properties/然後就可以用
tasksList = [
{ _id: 1, text: 'This is task 1' },
{ _id: 2, text: 'This is task 2' },
{ _id: 3, text: 'This is task 3' },
];
或者
static tasksList = [
{ _id: 1, text: 'This is task 1' },
{ _id: 2, text: 'This is task 2' },
{ _id: 3, text: 'This is task 3' },
];
來定義(^_-)-☆