Domanda |
Risposta |
inicjowanie projektu przez npm inizia ad imparare
|
|
|
|
|
inicjowanie projektu przez vite inizia ad imparare
|
|
|
|
|
inizia ad imparare
|
|
createApp(component). mount('#app')
|
|
|
inizia ad imparare
|
|
app. errorHandler=(err)=>{}
|
|
|
inizia ad imparare
|
|
|
|
|
inizia ad imparare
|
|
|
|
|
wiązanie pojedynczego atrybutu, np id inizia ad imparare
|
|
|
|
|
wiązanie wielu atrybutów, np id i class inizia ad imparare
|
|
v-bind="{id:'myId'class='myClass}"
|
|
|
wstawianie jako tekst, pomiędzy tagi inizia ad imparare
|
|
|
|
|
wywoływanie funkcji w wyrażeniach, np przy bindowaniu disabled inizia ad imparare
|
|
|
|
|
wywoływanie funkcji na evencie, np click inizia ad imparare
|
|
|
|
|
anulowanie domyślnego zachowania eventu, np submit inizia ad imparare
|
|
@submit. prevent="doSmt()"
|
|
|
wywoływanie funkcji z pojedynczym klawiszem specjalnym inizia ad imparare
|
|
|
|
|
wywoływanie funkcji na prawym klawiszu myszy inizia ad imparare
|
|
|
|
|
bindowanie funkcji na dynamicznym evencie inizia ad imparare
|
|
|
|
|
przekazywanie defaultowego obiektu event do handlera inizia ad imparare
|
|
@click="doSmt(123,$event)"
|
|
|
nasłuchiwanie w parencie na customowy event inizia ad imparare
|
|
|
|
|
Hook, the component has finished setting up its reactive state, but no DOM nodes have been created yet inizia ad imparare
|
|
|
|
|
Hook, component has finished the initial rendering and created the DOM nodes inizia ad imparare
|
|
|
|
|
Hook, can be used to access the DOM state before Vue updates the DOM. It is also safe to modify component state inside this hook. inizia ad imparare
|
|
|
|
|
Hook, called after the component has updated its DOM tree due to a reactive state change inizia ad imparare
|
|
|
|
|
Hook, all of child components have been unmounted inizia ad imparare
|
|
|
|
|
Two way data binding in forms inizia ad imparare
|
|
|
|
|
Tags which support v-model inizia ad imparare
|
|
|
|
|
Dynamiczna wartość true dla checkboxa inizia ad imparare
|
|
|
|
|
inizia ad imparare
|
|
input type="radio" value="myValue" v-model="myRef"
|
|
|
inizia ad imparare
|
|
input: value="text" @input="event => text=event. target. value"
|
|
|
2 way binding w parent'cie, np referencji parentRefName inizia ad imparare
|
|
v-model: propChildName="parentRefName"
|
|
|
2 way binding w child'zie, np referencji propChildName inizia ad imparare
|
|
defileProps(['propChildName']); defineEmits(['update: propChildName'])<input: value="propChildName" @input="$emit('update: propChildName', $event. target. value)"
|
|
|
updatowanie zbindowanej wartości po evencie change inizia ad imparare
|
|
|
|
|
castowanie zbindowanego modelu na number, np wieku inizia ad imparare
|
|
|
|
|
trimowanie zbindowanego modelu, np ulicy inizia ad imparare
|
|
|
|
|
inizia ad imparare
|
|
v-for="(item, index) in items": key="item. id"
|
|
|
iterowanie po zakresie liczb inizia ad imparare
|
|
|
|
|
iterowanie po kluczach obiektu inizia ad imparare
|
|
v-for="(value, key, index) in myObject"
|
|
|
inizia ad imparare
|
|
|
|
|
inizia ad imparare
|
|
|
|
|
korzystanie z nazwanego slotu w parencie, np childSlotName inizia ad imparare
|
|
|
|
|
korzystanie z nienazwanego slotu w parencie inizia ad imparare
|
|
|
|
|
definiowanie slotu w child'zie inizia ad imparare
|
|
slot name="childSlotName"
|
|
|
dyrektywa anulująca aktualizację componentu na zmianach referencji inizia ad imparare
|
|
|
|
|
referencja DOM, np myInput inizia ad imparare
|
|
input ref="myInput">const myInput=ref(null)
|
|
|
focusowanie pola w formularzu on load inizia ad imparare
|
|
onMounted(()=>{myInput. value. focus()})
|
|
|
bindowanie klas css jako inline condition inizia ad imparare
|
|
:class="{'myClass1': isClass1, 'myClass2': isClass2 }"
|
|
|
bindowanie klas css jako computed inizia ad imparare
|
|
const myClasses=computed(()=>({'myClass1': isClass1, 'myClass2': isClass2 }): class="myClasses"
|
|
|
bindowanie klas css jako array refów inizia ad imparare
|
|
const myClasses=ref(['myClass1', 'myClass2']): class="myClasses"
|
|
|
cashowanie stanu komponentu kiedy nie jest już wyświetlany inizia ad imparare
|
|
const myComp=shallowRef(MyComp) <KeepAlive><component: is="myComp">
|
|
|
inizia ad imparare
|
|
. v-enter-active,. v-leave-active {transition: opacity 0.5s ease}. v-enter-from,. v-leave-to {opacity: 0}
|
|
|
customowa dyrektywa focus inizia ad imparare
|
|
const vFocus={mounted: (el) => el. focus()} <input v-focus />
|
|
|
transition between components inizia ad imparare
|
|
|
|
|
inizia ad imparare
|
|
watch(myRef, async (newValue, oldValue) => {})
|
|
|
watcher który jest trigerowany na każdej zmianie referencji inizia ad imparare
|
|
watchEffect(async () => {await fetch('https://mydomian.com/${myRef. value}`)})
|
|
|
inizia ad imparare
|
|
|
|
|
obserwowanie wyniku wyrażenia inizia ad imparare
|
|
watch(() => (first. value+second. value), (sum)=>{})
|
|
|
asynchroniczne wgrywanie componentów inizia ad imparare
|
|
defineAsyncComponent({loader, loadingComponent, delay, errorComponent, timeout})
|
|
|
inizia ad imparare
|
|
router. beforeEach(async (to, from, next) => {})
|
|
|
inizia ad imparare
|
|
createRouter({history: createWebHistory(), routes: [{path" ", component: MyComp}]})
|
|
|
deklarowanie wstrzykiwanej wartości inizia ad imparare
|
|
|
|
|
inizia ad imparare
|
|
const myRef=inject('myRef')
|
|
|
What is the CLI command to create a new Vue. js SPA with the official Vue project scaffolding tool (create-vue)? inizia ad imparare
|
|
|
|
|
Hook called after the component instance is inserted into the DOM as part of a tree cached by <KeepAlive> inizia ad imparare
|
|
|
|
|
Hook called after the component instance is removed from the DOM as part of a tree cached by <KeepAlive> inizia ad imparare
|
|
|
|
|
Hook to be called when an error propagating from a descendant component has been captured inizia ad imparare
|
|
|
|
|
Component used to create links between routes inizia ad imparare
|
|
|
|
|
Component to embed router content placeholder inizia ad imparare
|
|
|
|
|
Get value of a route param, like id inizia ad imparare
|
|
const route = useRoute() const id = parseInt(route. params. id)
|
|
|
Redirect with view router inizia ad imparare
|
|
redirect: to => ({path: '/'})
|
|
|
Programatic router redirect with query param inizia ad imparare
|
|
router. push({path: '/register', query: {plan: 'private'}})
|
|
|
Redirect in router with history replacement inizia ad imparare
|
|
|
|
|
wstrzykiwanie parametrów do props w routerze inizia ad imparare
|
|
props: route => ({myparam: route. params. myparam})
|
|
|
dyrektywa która odpali eventhandler tylko taż inizia ad imparare
|
|
|
|
|
disable fallthrough attribute propagation inizia ad imparare
|
|
defineOptions({inheritAttrs: false})
|
|
|
access fallthrough attribute inizia ad imparare
|
|
|
|
|
bindowanie wszystkich fallthrough attributes inizia ad imparare
|
|
|
|
|