<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Vue.js - Page 7 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Vue.js&amp;p=6">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Vue.js&amp;p=8">3.Next</a>
</p>
<p><big> Components </big></p>
<p>Vue components extend basic <a href="page.php?w=HTML_element">HTML element</a>s to encapsulate reusable code. At a high level, components are custom elements to which the Vue's compiler attaches behavior. In Vue, a component is essentially a Vue instance with pre-defined options.The code snippet below contains an example of a Vue component. The component presents a button and prints the number of times the button is clicked:<syntaxhighlight lang="vue"><!doctype html><html>  <head>    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>  </head></html></!doctype></syntaxhighlight></p>

<p>  <body>    <div id="app">      <button-clicked :initial-count="0" />    </div></body></p>

<p>    <script>      const {        defineComponent,        ref,        computed,        watch,        watchEffect,        onMounted,        createApp      } = Vue</script></p><p>
<a accesskey="1" href="page.php?w=Vue.js&amp;p=6">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Vue.js&amp;p=8">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
