请问怎么动态设置九宫格

请问怎么动态设置九宫格

var xx = _node.get(cc.Sprite).spriteFrame;
if(xx){

                            _node.type = cc.Sprite.Type.SLICED;;
                            _node.get(cc.Sprite).type = cc.Sprite.Type.SLICED;
                        
                            xx.insetTop = _canshu['insetTop'];
                            xx.insetBottom = _canshu['insetBottom'];
                            xx.insetLeft = _canshu['insetLeft'];
                            xx.insetRight= _canshu['insetRight'];
                           
                            xx. _calculateUV();
                            xx._calculateSlicedUV();
                            
                        }

无效了 -----------------
请问怎么动态设置九宫格

var xx = _node.get(cc.Sprite).spriteFrame;
if(xx){
xx.insetTop = _canshu[‘insetTop’];
xx.insetBottom = _canshu[‘insetBottom’];
xx.insetLeft = _canshu[‘insetLeft’];
xx.insetRight= _canshu[‘insetRight’];
_node.get(cc.Sprite).onEnable();
}
2.2.0 这样居然 可以动态 九宫格????