The present invention relates to novel fused ring derivatives used as FGFR4 inhibitors, in particular to a compound of formula I or a pharmaceutically acceptable salt thereof, and further to use of the compound of formula I or a pharmaceutically acceptable salt thereof and the pharmaceutical composition thereof for the preparation of a medicament, in particular to the use for the preparation of a medicament for the treatment, prevention or prevention of a disease or condition mediated by FGFR4 activity.本發明關於可用作FGFR4抑制劑的新型稠環衍生物,具體關於結構式I所示的化合物或其藥學上可接受的鹽,進一步關於結構式I所示的化合物或其藥學上可接受的鹽及其藥物組合物在製備藥物中的用途,尤其是在製備用於治療、阻止或預防由FGFR4活性媒介的疾病或病症的藥物中的用途。