A single-shot measurement of electron emittance was experimentally accomplished using a focused transfer line with a dipole. The betatron phase of electrons based on laser wakefield acceleration (LWFA) is energy dependent owing to the coupling of the longitudinal acceleration field and the transverse focusing (defocusing) field in the bubble. The phase space presents slice information after phase compensation relative to the center energy. Fitting the transverse size of the electron beam at different energy slices in the energy spectrum measured 0.27 mm mrad in the experiment. The diagnosis of slice emittance facilitates local electron quality manipulation, which is important for the development of LWFA-based free electron lasers. The quasi-3D particle-in-cell simulations matched the experimental results and analysis well.