I have implemented DB2-style IDs for my database records in my Laravel 5.7 application, like this example: 201402241121000000000000
. When trying to use it in my Vue component, I used the following syntax:
<mycomponent v-bind:listing-key="{{ $listing->listing_key }}"></mycomponent>
In the JavaScript of the component, the prop is defined as follows:
export default {
props: {
'listingKey': String,
},
But, I encountered this error message:
[Vue warn]: Invalid prop: type check failed for prop "listingKey". Expected String with value "2.01402241121e+23", got Number with value 2.01402241121e+23.
It seems that the v-bind
is treating the ID as a number instead of a string. How can I resolve this issue?