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);
它不起作用。
答案 0 :(得分: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});