The shortest path counting is an important research problem in graph computing. It aims to query the number of shortest paths between vertices, which is widely used in path planning and recommendation, social network analysis, betweenness centrality calculation and so on. At present, more and more networks can be modeled as temporal graphs, but there is no research work on the shortest path counting query problem of temporal graphs. Compared with the static graph, the temporal graph increases the time information, the structure is more complex, and the activation time of the edge must be considered when querying the number of paths between vertices. Therefore, the shortest path counting method for the static graphs is no longer applicable to the temporal graphs, and querying on large-scale temporal graphs is more challenging. In order to solve the shortest path counting problem of temporal graphs, a method of TG-TL (Temporal Graph-Tree Label) index based on tree decomposition was proposed. The method consists of two stages: index construction and online query. In the index construction stage, the temporal tree decomposition algorithm was designed according to the attributes of the temporal graph, and the temporal graph was transformed into a tree structure. Then, according to the structure information of tree decomposition and convex path definition, an efficient index building algorithm was proposed. In the online query stage, an efficient temporal shortest path counting query algorithm was proposed based on TG-TL index. Experiments were carried out on 4 real datasets, and the experimental results showed that compared with the query algorithm based on TG-base (Temporal Graph-base) index, the proposed algorithm improved the query efficiency by 61% at least. Therefore, the proposed algorithm is efficient and effective for the shortest path counting problem of temporal graphs.