0
var Component = function (config) {
for (property in config) {
this[propety] = config[property]
}
}
var list = Array (
"Item 1",
"Item 2",
"Item 3");

var instance = Component(id: "XF-254", list: list);

它不起作用。

4

1 回答 1

1
var Component = function (config) {
   for (var property in config) {
     this[propety] = config[property]
   }
}

var list = [
"Item 1",
"Item 2",
"Item 3"];

var instance = new Component({id: "XF-254", list: list});
于 2013-06-21T06:14:30.270 回答