Discussion icon indicating copy to clipboard operation
Discussion copied to clipboard

props components auto inject "scope" text in array objects value.

Open TrungRueta opened this issue 10 years ago • 1 comments

Hi! i have got several times working with component props, and found this:

$conds from php data is :

$conds = [
   'products' => [ 
         'text' => 'Double Sided Banner Stand 33" x 85"', 
         'value' => '16' ]
   ];

** i added to component via prop filter ( i working on blade template )

<order-filter-label inline-template :filter="{{ json_encode($conds) }}">
</order-filterlabel>

after checking data in Vuetool chrome, i found that data filter after parsed auto inject scope after " syntax. I tried test many times and see this error only when data is value property of object in array. if only object then everything ok.

for now i have solution to fix is from php json_encode i use const JSON_HEX_QUOT:

json_encode($conds, JSON_HEX_QUOT)

then data is correct But i think i need to say this here then anyone got issue like me can confirm and maybe we will have better solution.

screen shot 2015-12-09 at 1 16 31 pm screen shot 2015-12-09 at 1 16 08 pm

i also insert 2 screenshot from chrome vuetool. you can see issue at 33" x 85" string.

thankyou for great Vue ! <3

TrungRueta avatar Dec 09 '15 06:12 TrungRueta

I'm also experiencing this issue. Default json-encoded string such as

<iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/8RETFyDKcw0\" frameborder=\"0\" allowfullscreen><\/iframe>

will turn into

<iframe width="560" height="315" src="scope.https://scope.www.youtube.com/scope.embed/8RETFyDKcw0" frameborder="0" allowfullscreen></iframe>

CreepGin avatar Dec 28 '15 08:12 CreepGin