Provided are an FGFR4 inhibitor having the structure of formula (I), and a preparation method therefor and the use thereof. The compound has a very strong inhibitory effect on FGFR4 kinase activity and has a very high selectivity, and can be widely used in the preparation of a drug for treating cancers, especially prostate cancer, liver cancer, pancreatic cancer, esophageal carcinomas, gastric cancer, lung cancer, breast cancer, ovarian carcinomas, colon cancer, skin cancer, glioblastomas or rhabdomyosarcomas, and is expected to be developed into a new generation of FGFR4 inhibitor drugs.本發明涉及一種具有式(I)結構的FGFR4抑制劑及其製備方法和應用,式中各取代基的定義如說明書和申請專利範圍所述。本發明所開發的式(I)系列化合物對FGFR4激酶活性具有很強的抑制作用,並具有非常高的選擇性,可廣泛應用於製備治療癌症特別是前列腺癌、肝癌、胰腺癌、食道癌、胃癌、肺癌、乳腺癌、卵巢癌、結腸癌、皮膚癌、神經膠質母細胞瘤或橫紋肌肉瘤的藥物,有望開發成新一代FGFR4抑制劑藥物。