how to use pca in cross validation

I am wondering how to use pca in cross validation. I noticed that there are 4 codes of pca, which node shall I use , or how many nodes are combined together?