How to display PHP data in a vue component?

Vue.component('add-edu', {
 template: `
the <div>
 <div class="gray_dashed"> 
</div>
 <div class="profileForm_row">
 <label class="profileForm_label" for="">Education</label>
 <select class="profile_select" name="education[]">
 <option value="" selected readonly <?php if(isset($_POST['education'])){if($_POST['education']==") echo ' selected="selected"';}?> >Specify education</option>
 <option value="Highest" <?php if(isset($_POST['education'])){if($_POST['education']=='Higher') echo ' selected="selected"';}?>>Higher</option>
 <option value="bachelor" <?php if(isset($_POST['education'])){if($_POST['education']=='some College') echo ' selected="selected"';}?>>Some College</option>
 <option value="Secondary" <?php if(isset($_POST['education'])){if($_POST['education']=='Secondary') echo ' selected="selected"';}?>>Secondary</option>
 <option value="Secondary" <?php if(isset($_POST['education'])){if($_POST['education']=='Secondary') echo ' selected="selected"';}?>>Secondary</option>
 <option value="No education" <?php if(isset($_POST['education'])){if($_POST['education']=='No education') echo ' selected="selected"';}?>>Without education</option>
</select>
 </div> 
 <div class="profileForm_row">
 <label class="profileForm_label" for="">City</label>
 <input class="profileForm_input" placeholder="City" type="text" name="edu_city[]" value="<?php echo @$data['edu_city']; ?>">
</div>
 <div class="profileForm_row">
 <label class="profileForm_label" for="">school</label>
 <input class="profileForm_input" placeholder="school" type="text" name="edu_name[]" value="<?php echo @$data['edu_name']; ?>">
</div>
 <div class="profileForm_row">
 <label class="profileForm_label" for="">Faculty</label>
 <input class="profileForm_input" placeholder="Faculty" type="text" name="faculty[]" value="<?php echo @$data['faculty']; ?>">
</div>
 <div class="profileForm_row">
 <label class="profileForm_label" for="">Specialty</label>
 <input class="profileForm_input" placeholder="Specialty" type="text" name="specialty[]" value="<?php echo @$data['specialty']; ?>">
</div>
 <div class="profileForm_row">
 <label class="profileForm_label" for="">end date</label>
 <p><input class="profile_select profile_select__date" name="edu_date[]" type="month" list="monthList" value="<?php echo @$data['edu_date']; ?>"></p>
 <datalist id="monthList">
</datalist>
</div>
</div>
`
});


Problem : the component displays, but php outputs the data as just a text code. How to make php code work, and not just text
March 24th 20 at 14:01
3 answers
March 24th 20 at 14:03
Mixed the worst of both.

PHP form data to json.
At the vue display them.
March 24th 20 at 14:05
php code is executed in files with the extension php.

Find more questions by tags Vue.jsBackendPHP