To expand a bit - the traditional identity was more like "We are civilized just like you."
"Chinese," in this particular context, would be similar to "Latin," not really an ethnic marker but a commonly agreed-upon high culture. Japanese and Koreans had similar claims about this "Chinese-ness" without referring to themselves as literal Chinese.
(Such a discourse was essentially a counterargument against the traditional Sino-supremacist view that only the Middle Kingdom was civilized and therefore above everyone else. The counterargument was that we are also civilized despite not being in the Middle Kingdom, and therefore equal in status.)
For instance, the first two lines of the main text of
Bình Ngô đại cáo (1427):
惟我大越之国,实为文献之邦
Our country of Dai Viet, is in fact a nation of culture (lit. "nation of literature" or "nation of letters").
山川之封域既殊,南北之风俗亦异
The mountains and rivers have already marked out different purviews; therefore, the South and North customs are also not alike.
We can see that the identification already lies in independent Dai Viet, and it further stresses that even though we are not "China," we are still a "nation of literature," and you northerners shouldn't treat us like barbarians.