European leaders have committed to beef up military spending as Ukrainian President Volodymyr Zelensky says he can salvage his relationship with Donald Trump.