China’s economic growth met the government’s target last year despite a pronounced slowdown in recent months, weathering Donald Trump’s trade war by boosting exports outside the US.