Coggle requires JavaScript to display documents.
Vue.createApp({}).mount('#app');
{{ expression }}
#app1, #app2
const vm = Vue.createApp({
data() {
return {
name: "John"
setTimeout(() => {
vm.name = 'Bob'
}, 2000)
v-cloak
[v-cloak] {
display: none;
}
<input type="text" v-model="name" />
:value
@input
v-bind => :
v-html
v-on => @
v-else-if
v-show
<input type="text" @input="setName($event, 'Max')">
npm install -g @vue/cli vue create appname npm run serve
import { createApp } from 'vue'; import App from './App.vue; import Greeting from './components/Greeting.vue; const vm = createApp(App); vm.component('Greeting', Greeting); vm.mount(#app);
methods: { onClick() { this.$emit('pass-click', props) } }
props: { age: { type: Number, validator(value) { return value < 130; } } }
<slot name="help">Replacement text</slot>
<template v-slot:help></template>
<keep-alive> // unmouned hook is no longer triggered <component :is="Name"></component> </keep-alive> activated() {} deactivated() {}
immediate: true