In recent years, deep learning has shown great potential in the field of brain-computer interfaces, especially Long Short-Term Memory (LSTM) networks, which have achieved good performance in EEG source imaging. In this paper, we propose a method based on Temporal Convolutional Networks (TCN) for EEG source imaging, with the introduction of multi-head attention mechanism in the network. Compared to traditional TCN networks, we utilize a variant of TCN that can effectively extract temporal information by simultaneously considering past and future information. The multi-head self-attention mechanism enables the model to allocate attention weights more reasonably and improves the model's expressive power. Experimental results demonstrate that our proposed method performs well in EEG source imaging.