Vue'ni syntax ko'proq HTMl structurega tortadi, blaki shu narsa uni backendchilar tanlashiga sababdir yana kim bilsin. Agar sizda HTML template bo'ladigan bo'lsa uni React codebase'ga o'tkazishdan ko'ra Vue'ga o'tkazish siz uchun osonroq va kam harajat bo'lishi mumkin.
Ok unda boshladik!
# Project yaratish
npm create vue@latest
// Minimal Vue example
import { createApp, ref } from "vue";
createApp({
setup() {
return {
count: ref(0),
};
},
}).mount("#app");
createApp() bu yerda HTMl rootga Vue appni bind qilyapti,#app bu root huddi Reactdagi #root kabisetup() shu component mount bo'lganda ishga tushadigan kod<div id="app">
<button @click="count++">
Count is: {{ count }}
</button>
</div>
bu esa Vue dagi template namuna,
@click bu Reactdagi onClick kabi, Vueda on o'rniga @ ishlatib ketsangi bo'ldi.{{ chop_etiluvchi }} bu Reactdagi ${} kabi siz biror HTML code ichida dynamic ishlata olishiz uchun