Covalent organic frameworks (COFs) with well-controlled structures and highly aligned channels could offer good conditions for ion motion. To date, COFs with neutral skeletons have been well designed and synthesized, while there are limited reports of COFs with charged characteristics (ionic-COFs). Ionic-COFs possess charge characteristics in the frameworks, and these unique features make them good candidate materials as solid electrolytes for lithium ion conduction. Here, we employ imidazolium-based monomers as building blocks to construct a new cationic COF (Im-COF-Br) via Schiff base reaction, which possesses positively charged characteristics in the COF skeletons, tunable counter-anions, and the largest pore size among reported COFs (5.57 nm). By adopting an ion-exchange strategy, the counter-ion Br- was replaced by bis(trifluoromethylsulfonyl)imide (TFSI-) ions, which endows the COF based material with good suitability for improving the lithium ion conductivity. As a result, Im-COF-TFSI based electrolytes possess high lithium ion conductivities (as high as 4.64 × 10-4 and 4.04 × 10-3 S cm-1 at 353 and 423 K) and good thermostability, as well as good contact with the electrodes and a stable interface with the Li metal. Furthermore, the assembled Li/Im-COF-TFSI@Li/LiFePO4 all-solid-state Li-ion battery exhibits an initial discharge capacity of 123.3 mA h g-1, and reserves 91.6% capacity after 100 cycles at 353 K. This work may provide a strategy for building a new type of ionic COF that can be utilized as a desirable material in solid electrolytes for lithium-ion batteries.