Əsas metodlardan başqa hansı HTTP metodları mövcuddur?
Frontend
setup() (setuppan əvvəl beforeCreate və created işləyir) onBeforeMount onMounted onBeforeUpdate onUpdated onBeforeUnmount onUnmounted Val: setup Val: beforeCreate Val: created Val: beforeMount Uşaq: setup Uşaq: beforeCreate Uşaq: created Uşaq: beforeMount Uşaq: mounted Val: mounted <template> <button @click="onClick"> {{ text }} </button> </template> <script lang="ts"> interface Props { text: string; } const props = defineProps<Props>(); interface Emit { myClick: [string]; } const emits = defineEmit<Emit>(); function onClick() { } </script> <template> <MyButton :text="Beni tıkla"></MyButton> </template>
Bir dəyişən var və bu, Book və ya Video tipində ola bilər. Obrazın tipini necə yoxlamaq olar? Tip qoruma funksiyası hansı növü qaytarır?
// comp.vue <template> <ul v-if="products != null"> <li v-for="(pr, i) in products">{{pr}}</li> </ul> </template> <script> import {getProducts} from ""; import {ref} from "vue"; const products = ref(null); onMounted(() => { getProducts().then(result => products.value = result) }) </script> setup() (boshqa yaratishdan oldin va createddan oldin bajariladi) onBeforeMount onMounted onBeforeUpdate onUpdated onBeforeUnmount onUnmounted Ota: setup Ota: beforeCreate Ota: created Ota: beforeMount Ota: mounted Farzand: setup Farzand: beforeCreate Farzand: created Farzand: beforeMount Farzand: mounted Ota: mounted <template> <div> <slot name=""></slot> </div> </template>
TypeScript-in hansı üstünlükləri var?
HTTP sorğusu nədən ibarətdir?
console.log('1'); setTimeout(() => console.log('2'), 0); Promise.resolve().then(() => console.log('3')); console.log('4');
JavaScript-də bağlamalar haqqında danışın. Vue 3-də bağlamalar harada istifadə olunur?
Vue-də computed və watchers nədir?
Vue 3 komponentində getProducts funksiyasını çağırın və alınan nəticələri şablonda göstərin.
Virtual DOM nədir və necə işləyir?
const hadisələr = [ { ad: 'Маша', tarix: '[phone]' }, { ad: 'Даша', tarix: '[phone]' }, { ad: 'Ваня', tarix: '[phone]' }, { ad: 'Петя', tarix: '[phone]' }, { ad: 'Митя', tarix: '[phone]' }, ];
Vue 3-də həyat dövrü hookları haqqında danış. Səhifə yüklənərkən valide və uşaq komponentlərində hooklar hansı ardıcıllıqla çağırılır?
TypeScript-də Type Guard nədir?
İş təcrübənizdən danışın.
Vue 2-dən Vue 3-ə keçmisiniz və köçürmədə iştirak etmisiniz. Daha ətraflı məlumat verə bilərsinizmi?
HTTP protokolları və istifadə olunan metodlar haqqında məlumat verin.
Reaktivlik nədir və Vue-də necə işləyir? Vue 2 və Vue 3 arasında reaktivlik fərqi nədir?
Məhsullar siyahısını qaytaran fetch sorğusu yazın. Onu təkrar istifadə oluna bilən ayrıca funksiyada bağlayın.
Vue-də vəziyyəti harada saxlamaq olar? Hansı hallarda Pinia/Vuex istifadə etmək daha yaxşıdır və hansı hallarda provide/inject istifadə etmək daha yaxşıdır?