How should one refer to the value set up within an object passed to v-bind
to display it?
Example:
<p v-bind="{id: 'myId'}">{{ /*what to state here to have 'myId' displayed?*/ }}</p>
How should one refer to the value set up within an object passed to v-bind
to display it?
Example:
<p v-bind="{id: 'myId'}">{{ /*what to state here to have 'myId' displayed?*/ }}</p>
The <p>
is not a child component, everything here is all in the same scope. You cannot refer to its attributes from its contents. As in Bert's example, you simply have to put what you want in both places.
If you want to use a variable for the id
and for the contents, you can do that, but you have to explicitly put it in both places:
<p :id="myIdVariable">{{myIdVariable}}</p>