V
V
Vlad Volodko2019-07-12 11:11:20
JSON
Vlad Volodko, 2019-07-12 11:11:20

How to process json in vue?

Hello. I’m interested in such a question, I don’t even know how to describe the problem, I have a file that returns me joxi.ru/v29vYV7iZ9zJaA
Previously, this file used angularJs and it processed it and worked fine with it, now I’m rewriting the functionality on vuejs using axios and this file vue does not work, rewriting the file so that it returns the data in the right form is not a problem.
If you check the answer through typeof, it shows string
UPD
A piece of file

"deliverySystems": {
<?$k=1;?>
  <?while ($ar_dtype = $db_dtype->Fetch())
  {
     //бесплатная доставка Укрпочты (временно)
        if($arResult['allSum']>1500){
          if($ar_dtype['ID'] == 16){
            continue;
          }

        } elseif($arResult['allSum'] < 1500) {

          if($ar_dtype['ID'] == 16){
            if($aks_count_all > 1){
              continue;
            }
          }
          if($ar_dtype['ID'] == 17){
            if($aks_count_all < 2){
              continue;
            }
          }
        }


       if ($k!=1){echo ',';}


       ?>
     "<?=$ar_dtype['ID']?>":{
      "name":"<?if($ar_dtype["NAME"] != 'Justin') { echo $ar_dtype["NAME"]; } else { echo 'Отделение «Justin» (Фора, Сільпо)'; }?>",
      "price":"<?=$ar_dtype["PRICE"]?>"
    }
  <?$k++;
  }?>

}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nvdfxx, 2019-07-12
@nvdfxx

studio code

S
Spunreal, 2019-07-14
@Spunreal

JSON.parse()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question