<p v-text="foo"> vs {{ foo }} in vue?

what is the difference between <p v-text="foo"> and {{ foo }} in vue?

I know {{ foo }} is some DOM thingy, but they achieve the same function, so is <p v-text="foo"> also doing something to DOM?


#1 Answers

They do exactly the same thing. From the v-text docs:

Internally, {{ Mustache }} interpolations are also compiled as a v-text directive on a textNode.

With either one, the compiler will turn the template markup into the same node.

Comments