We report a rapid strategy to construct self-propelled functional tubular micromotors. Based on the established strategy, magnetic covalent-organic-framework-functionalized micromotors were fabricated to implement sensing of explosives in water. Such micromotors can complete fluorescent "On-Off" detection of trace explosive 2,4,6-trinitrophenol within 10 min.