0

以下のコードでは、引数として渡されるオプション配列をどのように使用できますかdrawOval

drawOval=function(options) {
    $triangle = new Triangle({
        // how can I use options array here
        // the format it accept is top:450,
        // left:500,width:200
    });
};
opt = new Array(
    top: 450,
    left: 500,
    width: 200,
    height: 200,
    fill: 'rgb(204,0,107)'
);
drawOval(opt);
4

1 に答える 1

0

基本的に、配列ではなくオブジェクトが必要です。

opt= {
    top:100,
    left:200,
    width:200,
    height:200,
    fill:'rgb(12,0,107)'
}
drawOval(opt);
于 2012-04-24T13:01:02.083 に答える