[Vuejs]-Escaping symbols from the json data

0👍

You’re using v-bind via the shorthand of :. It expects an expression. You are trying to pass a string. What Vue sees is like

:gallery="this is a string"

which is invalid syntax because Vue tries to interpret this is a string as an expression. You could quote it:

:gallery="'this is a string'"

and it would be valid, but it makes more sense to just do

gallery="this is a string"

0👍

Well, according to laravel-news, the best way to solve this problem is to use double encoding:

class AppServiceProvider extends ServiceProvider
{

  public function boot()
  {
    Blade::doubleEncode();
  }
}

Leave a comment