The quasi-solid-state electrolytes (QSSEs) with an inorganic skeleton, a solid-liquid composite material combining their respective merits, exhibit high ionic conductivity and mechanical strength. However, most quasi-solid electrolytes prepared by immobilizing ionic liquid (IL) or organic liquid electrolyte in inorganic scaffold generally have poor interface compatibility and low lithium ion migration number, which limits its application. Herein, we design and prepare a ZIF-8-based QSSE (ZIF-8 QSSE) in which the ZIF-8 has a special cage structure and interaction with the guest electrolyte to form a composite electrolyte with good ionic conductivity about 1.05 × 10-4 S cm-1 and a higher lithium-ion transference number of about 0.52. With the ZIF-8 QSSE, a protype lithium battery coupled with LiCoO2 cathode shows good electrochemical performances with an initial discharge capacity of 135 mAh g-1 at 50 mA g-1 and a remaining capacity of 119 mAh g-1 after 100 cycles, only 0.119% capacity degradation per cycle. It is worth noting that the ZIF-8-based QSSEs have good thermal stability up to 350 °C that does not show thermal runaway, which is significantly higher than that of a conventional organic liquid battery system.