Vue.js

Vue.js (commonly referred to as Vue; pronounced "view" ) is an open-source model–view–viewmodel front end JavaScript framework for building user interfaces and single-page applications.

Uses your system voice; voice and rate in settings.

Snapshot

≈ 2 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

Vue.js (commonly referred to as Vue; pronounced "view" ) is an open-source model–view–viewmodel front end JavaScript framework for building user interfaces and single-page applications. It was created by Evan You and is maintained by him and the rest of the active core team members.

Vue features an incrementally adaptable architecture that focuses on declarative rendering and component composition. import { ref, computed, watch, watchEffect, onMounted } from 'vue' const props = defineProps () const count = ref(0) const doubleCount = computed(() => count.value * 2) function handleClick(): void { count.value += 1 } watch(count, (newValue, oldValue) => { console.log(`The value of count is changed from ${oldValue} to ${newValue}.`) }) watchEffect(() => console.log(`Double the value of count is ${doubleCount.value}`)) onMounted(() => { count.value = props.initialCount }) Clicked times import ButtonClicked from './ButtonClicked.vue' // main.ts import { createApp } from 'vue' import App from './App.vue' createApp(App).mount('#app') {{syntaxhighlight|lang=vue|code= ... ... const User = { template: ' User ' }; const router = new VueRouter({ routes: [ { path: '/user/:id', component: User } ] }); ... }} The code above: Sets a front-end route at websitename.com/user/ . Which will render in the User component defined in (const User...)

Allows the User component to pass in the particular id of the user which was typed into the URL using the $route object's params key: $route.params.id . This template (varying by the params passed into the router) will be rendered into inside the DOM's div#app. The finally generated HTML for someone typing in: websitename.com/user/1 will be:

Text derived from https://en.wikipedia.org/w/index.php?oldid=1376019324 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

22 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.