2. Let the set $\left\{\left.\frac{3}{a}+b \right\rvert\, 1 \leqslant a \leqslant b \leqslant 2\right\}$ have the maximum element and the minimum element as $M, m$, respectively, then the value of $M-m$ is $\qquad$.
Since $\frac{3}{a}+b \geqslant \frac{3}{a}+a \geqslant 2 \sqrt{3}$, equality holds when $a=b=\sqrt{3}$, then $m=2 \sqrt{3}$; while $\frac{3}{a} \leqslant 3, b \leqslant 2 \Rightarrow \frac{3}{a}+b \leqslant 5$, equality holds when $a=1, b=2$, then $M=5$. Therefore, the value of $M-m$ is $5-2 \sqrt{3}$.