3.x版本获取一个节点的宽高每次都得通过getComponent(UITransform)来获取有些麻烦啊

还有其它方法吗?我打印node信息,其实里面有width和height的,但是在编辑器里编写会报错