<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Githu Kelvin</title>
    <description>The latest articles on DEV Community by Githu Kelvin (@githukelvin).</description>
    <link>https://dev.to/githukelvin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F890636%2F26471fa0-d5fa-4be1-b655-425bb3c6a5bd.png</url>
      <title>DEV Community: Githu Kelvin</title>
      <link>https://dev.to/githukelvin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/githukelvin"/>
    <language>en</language>
    <item>
      <title>VUE.JS FORGE 4 HACKATHON</title>
      <dc:creator>Githu Kelvin</dc:creator>
      <pubDate>Sun, 30 Jul 2023 10:59:22 +0000</pubDate>
      <link>https://dev.to/githukelvin/vuejs-forge-4-hackathon-3g34</link>
      <guid>https://dev.to/githukelvin/vuejs-forge-4-hackathon-3g34</guid>
      <description>&lt;p&gt;📣 Gleam Competition alert 📣&lt;/p&gt;

&lt;p&gt;Join Vue.js Forge &amp;amp; win a share of $5,000 in prizes!&lt;/p&gt;

&lt;p&gt;👵 &lt;br&gt;
&lt;a class="mentioned-user" href="https://dev.to/vueschool_io"&gt;@vueschool_io&lt;/a&gt;&lt;br&gt;
 Lifetime access&lt;br&gt;
💚 &lt;br&gt;
&lt;a class="mentioned-user" href="https://dev.to/masteringnuxt"&gt;@masteringnuxt&lt;/a&gt;&lt;br&gt;
 Courses&lt;br&gt;
🏆 &lt;br&gt;
@vuejscertify&lt;br&gt;
 Exam&lt;br&gt;
👕 &lt;br&gt;
@kadena_io&lt;br&gt;
 Hoodie&lt;br&gt;
🎟️ Vue.js Workshops&lt;/p&gt;

&lt;p&gt;And so much more!&lt;/p&gt;

&lt;p&gt;Follow the steps below 👇&lt;br&gt;
Help me win a share of over $5,000 in prizes in this awesome free competition from Vue.js Forge and Vue School! &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yBBLiN8G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v1awnc4zywn6hoymcxcm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yBBLiN8G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v1awnc4zywn6hoymcxcm.png" alt="Image description" width="800" height="537"&gt;&lt;/a&gt;&lt;a href="https://wn.nr/v2ZGMmK"&gt;https://wn.nr/v2ZGMmK&lt;/a&gt; &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>hackathon</category>
      <category>vue</category>
      <category>frontend</category>
    </item>
    <item>
      <title>I've just completed a front-end coding challenge from</title>
      <dc:creator>Githu Kelvin</dc:creator>
      <pubDate>Tue, 06 Jun 2023 11:40:55 +0000</pubDate>
      <link>https://dev.to/githukelvin/ive-just-completed-a-front-end-coding-challenge-from-1bdi</link>
      <guid>https://dev.to/githukelvin/ive-just-completed-a-front-end-coding-challenge-from-1bdi</guid>
      <description>&lt;p&gt;I've just completed a front-end coding challenge from @frontendmentor! 🎉&lt;/p&gt;

&lt;p&gt;You can see my solution here: &lt;a href="https://www.frontendmentor.io/solutions/newsletter-signup-form-with-success-message-NBsODB5IiW"&gt;https://www.frontendmentor.io/solutions/newsletter-signup-form-with-success-message-NBsODB5IiW&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any suggestions on how I can improve are welcome!&lt;/p&gt;

&lt;h1&gt;
  
  
  FrontendMentor #CodeChallenge
&lt;/h1&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Vue Directives and many more</title>
      <dc:creator>Githu Kelvin</dc:creator>
      <pubDate>Mon, 05 Jun 2023 06:21:19 +0000</pubDate>
      <link>https://dev.to/githukelvin/vue-directives-and-many-more-9m3</link>
      <guid>https://dev.to/githukelvin/vue-directives-and-many-more-9m3</guid>
      <description>&lt;p&gt;Hello  developers here  is my second journey into this wonderland of vue.js .It is an awesome journey first let me point out why i like vue even if am just a beginner .&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt; Below is image with backtick  between mustache note that i added those backtick when publish to avoid this error &lt;em&gt;whoops, something went wrong: liquid error: liquid variables are disabled&lt;/em&gt; So it is not a vue.js syntax remember so .happy reading&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AL7-lbrB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fy4bnjgm4jkjl61bol0v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AL7-lbrB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fy4bnjgm4jkjl61bol0v.png" alt="backtick" width="401" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are some of my points:-&lt;br&gt;
        &lt;/p&gt;
&lt;ul&gt;

        &lt;li&gt;Vue keeps the html same no knew syntax or concept introduced&lt;/li&gt;

        &lt;li&gt;Vue  is declarative in terms of you just describe your output and Vue just does the other work&lt;/li&gt;

        &lt;li&gt;Lastly  it is easy to maintain.Or let me say at this level  this why i love it .&lt;/li&gt;

        &lt;/ul&gt;
&lt;br&gt;
So on this Second tour on the wonderland (&lt;strong&gt;&lt;em&gt;vue&lt;/em&gt;&lt;/strong&gt;) i got to explore not much but the core basics so  here it is:-&lt;br&gt;
        &lt;ol&gt;

        &lt;li&gt;Instantiating a Vue app using CDNs&lt;/li&gt;

        &lt;li&gt;data  function&lt;/li&gt;

        &lt;li&gt;Interpolation&lt;/li&gt;

        &lt;li&gt;Vue Directives&lt;/li&gt;

        &lt;li&gt;Conditional rendering&lt;/li&gt;

        &lt;li&gt;ref and $ref&lt;/li&gt;

        &lt;/ol&gt;

&lt;h2&gt;Creating a vue app using CDN &lt;/h2&gt;

&lt;p&gt;There  is  3 type of CDNs to use vue   with:-&lt;/p&gt;

&lt;p&gt;1.unpkg which i will use over  here  below it is the script:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.jsdelivr&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    &amp;lt;script src="https://cdn.jsdelivr.net/npm/vue@3.3.4/dist/vue.global.min.js"&amp;gt;&amp;lt;script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.cdnjs -&amp;gt; It has many  files thhe link to it is here &lt;a href="https://cdnjs.com/libraries/vue"&gt;cdnjs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you have placed  any of link in the  html either you can create a new js file to write your code or just use it  in the html file under the script tag i will use script tag  here i what it looks&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

         &amp;lt;!DOCTYPE html&amp;gt;
        &amp;lt;html lang="en"&amp;gt;
        &amp;lt;head&amp;gt;
            &amp;lt;meta charset="UTF-8"&amp;gt;
            &amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&amp;gt;
            &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
            &amp;lt;title&amp;gt;v-on  directive&amp;lt;/title&amp;gt;
        &amp;lt;/head&amp;gt;
        &amp;lt;body&amp;gt;
        &amp;lt;div id="app"&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;script src="https://unpkg.com/vue@next"&amp;gt;&amp;lt;/script&amp;gt; //link to the cdn
                &amp;lt;script&amp;gt;
                    //My code here
                &amp;lt;/script&amp;gt;
        &amp;lt;/body&amp;gt;
        &amp;lt;/html&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This&lt;br&gt;
 &lt;code&gt; div it is used by vue to control our app by vue it doesn't need to be a div it can be any html tag .This is also  the the same for the id it can be a class but recomended to use  id because it is unique&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div id="app"&amp;gt;&amp;lt;/div&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;After this under the script tag we can start creating our app like before&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    &amp;lt;script&amp;gt;
       let app =  Vue.createApp({});
         let vm = app.mount("#app")
    &amp;lt;/script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code above by doing so you will have started an vue app and we can start manupilating our website.&lt;/p&gt;

&lt;p&gt;The  Vue in the code is an object that has function createApp that it argument it is an object and in that object  it is where we will control our vue website.let start.&lt;/p&gt;

&lt;h3&gt;The data function&lt;/h3&gt;

&lt;p&gt;The data function is one of the values of our object of createApp function&lt;br&gt;
The data function it is a function that just returns an object and it must be an object and in it what we return can be used as output in our website let the fun begin:&lt;br&gt;
In this funtion we wan return anything but keynote is that &lt;b&gt;The name of the function must be data which it is a reserved word in vue&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;So in our script let start out putting:-&lt;br&gt;
    As i said before we can return anything json,object,array,numbers,strings anything but not functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
       let app =  Vue.createApp({
           data(){
                return{
                    title:'v-for:iterate over[]  or {}',
                    cities:['Dhaka','Chittagong','Rajshahi','Khulna','Barishal','Sylhet','Rangpur','Mymensingh'],
                    json:[
                        {Brand:'Toyota',model:'Supra',year:2002},
                        {Brand:'Mercedes',model:'Amg',year:2011},
                        {Brand:'Honda',model:'NSX',year:2014},
                        {Brand:'Nissan',model:'GT-R',year:2017},
                        {Brand:'Toyota',model:'Camry',year:2014},
                        {Brand:'Mercedes',model:'G-wagon',year:205},
                        {Brand:'Honda',model:'Civic',year:2010},
                        {Brand:'Nissan',model:'Nism0',year:2019},
                    ],
                    car:{Brand:'Nissan',model:'GT-R32',year:2013}, 
                    cars:[
                    {Brand:'Nissan',model:'GT-R32',year:2013},
                    {Brand:'Nissan',model:'GT-R35',owner:"kelvin"},
                    {Brand:'Toyota ',owner:'Nash',price:"30m"}
                    ]


                }
            }

         });
         let vm = app.mount("#app")
    &amp;lt;/script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As illustrated above you can see multiple data  types. The above code i will use it to illustrate the other parts.&lt;/p&gt;

&lt;h2&gt;Interpolation&lt;/h2&gt;

&lt;p&gt;This is the folowing this is outputing data on the website using Mustachetag or this &lt;code&gt;{{}}&lt;/code&gt;&lt;br&gt;
example took the part of it .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    &amp;lt;div id="app" &amp;gt;
        &amp;lt;h2&amp;gt;`{{ title }}`&amp;lt;/h2&amp;gt;

    &amp;lt;/div&amp;gt;
    &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;
        &amp;lt;script&amp;gt;
           let app = Vue.createApp({
            data(){
                    return{
                        title:'v-for:iterate over[]  or {}',
                    }
                }

            });
            let vm = app.mount("#app")
        &amp;lt;/script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here it is the output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zpxiV8hQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3pyk6efzpvslaie0118a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zpxiV8hQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3pyk6efzpvslaie0118a.png" alt="image for interpolation" width="800" height="65"&gt;&lt;/a&gt;" &lt;/p&gt;
Fig.1.Image for interpolation



&lt;p&gt;Above it is interpolation   or using Mustachetag to display&lt;/p&gt;

&lt;h2&gt;Vue directives &lt;/h2&gt;

&lt;p&gt;Below it is a list of vue directive&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;v-html&lt;/li&gt;
&lt;li&gt;v-for&lt;/li&gt;
&lt;li&gt;v-model&lt;/li&gt;
&lt;li&gt;v-text&lt;/li&gt;
&lt;li&gt;v-if,v-else-if,v-else&lt;/li&gt;
&lt;li&gt;v-on&lt;/li&gt;
&lt;li&gt;v-cloak&lt;/li&gt;
&lt;li&gt;v-bind&lt;/li&gt;
&lt;li&gt;v-once&lt;/li&gt;
&lt;li&gt;v-is&lt;/li&gt;
&lt;li&gt;v-show&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The list is some of v-directive there is also custom v-directives&lt;br&gt;
What is a v-directive composed of&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

        v-dir_name:v-attr="v-argument"


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;1.v-html&lt;/h4&gt;

&lt;p&gt;This directive gives you ability to output html code in vue but not recomended since it introduces xss vulnerability&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

      &amp;lt;div id="app"&amp;gt;
        &amp;lt;h2&amp;gt;`{{ title }}`&amp;lt;/h2&amp;gt;
        &amp;lt;h1&amp;gt;`{{ html }}`&amp;lt;/h1&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
       let app= Vue.createApp({
            data() {
                return {
                    title:"Illustrating v-html",
                    html: "&amp;lt;h1&amp;gt;This is heading&amp;lt;/h1&amp;gt;"
                }
            }
        });

        let vm = app.mount("#app");
    &amp;lt;/script&amp;gt;



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here it is output of the above code &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IUbAC-Dt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fje64nuqnwp9mcvu07r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IUbAC-Dt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fje64nuqnwp9mcvu07r.png" alt="image of Mustachehtml" width="636" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As output showing it can't compile the  html.below is how //v-html is used&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

     &amp;lt;div id="app"&amp;gt;
        &amp;lt;h2&amp;gt;`{{ title }}`&amp;lt;/h2&amp;gt;
        &amp;lt;h1 v-html="html"&amp;gt;&amp;lt;/h1&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
       let app= Vue.createApp({
            data() {
                return {
                    title:"Illustrating v-html",
                    html: "&amp;lt;h1&amp;gt;This is heading&amp;lt;/h1&amp;gt;"
                }
            }
        });

        let vm = app.mount("#app");
    &amp;lt;/script&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output below  as it shows now the  code was compile as a html code remember don't use it occasionally.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---KQXoc1U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mg57t6gwdchs3zgnha4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---KQXoc1U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mg57t6gwdchs3zgnha4z.png" alt="vhmtl image" width="606" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;2.v-text&lt;/h4&gt;

&lt;p&gt;This v-directive is the same as interpolation or the Mustachetag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


    &amp;lt;div id="app"&amp;gt;
        &amp;lt;h2&amp;gt;`{{ title }}`&amp;lt;/h2&amp;gt;
        &amp;lt;h2  v-text="text"&amp;gt;&amp;lt;/h2&amp;gt;
        &amp;lt;h1 v-html="html"&amp;gt;&amp;lt;/h1&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
       let app= Vue.createApp({
            data() {
                return {
                    title:"Illustrating v-html",
                    text: "Illustrating v-text",
                    html: "&amp;lt;h1&amp;gt;This is heading&amp;lt;/h1&amp;gt;"
                }
            }
        });

        let vm = app.mount("#app");
    &amp;lt;/script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result for this snippet is as below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZoeXfJxf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dpi4v1h0mulh5l48ziby.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZoeXfJxf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dpi4v1h0mulh5l48ziby.png" alt="image for v-text" width="640" height="420"&gt;&lt;/a&gt;&lt;br&gt;
The selected is the output for the v-text&lt;/p&gt;

&lt;h4&gt;3.v-once&lt;/h4&gt;

&lt;p&gt;This directive will just render an element just once.And note to take is that the v-once doesn't require a v-attribute and v-argument as shown below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

          &amp;lt;h2&amp;gt;`{{ title }}`&amp;lt;/h2&amp;gt;
        &amp;lt;h2  v-text="text"&amp;gt;&amp;lt;/h2&amp;gt;
        &amp;lt;h1 v-html="html"&amp;gt;&amp;lt;/h1&amp;gt;
        &amp;lt;h2 v-once  v-text="vonce"&amp;gt;&amp;lt;/h2&amp;gt;
        &amp;lt;h2&amp;gt;`{{ vonce}}` don't have v-once&amp;lt;/h2&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
       let app= Vue.createApp({
            data() {
                return {
                    title:"Illustrating v-html",
                    text: "Illustrating v-text",
                    html: "&amp;lt;h1&amp;gt;This is heading&amp;lt;/h1&amp;gt;",
                    vonce: "This is v-once that renders once  only"
                }
            }
        });

        let vm = app.mount("#app");

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output is as below :-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jvfJUoV5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgrb8i0gew8x5vgoskg7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jvfJUoV5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgrb8i0gew8x5vgoskg7.png" alt="output" width="633" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Image above shows two output  one has v-once the other one doesn't have.&lt;br&gt;
So we will change the value of vonce in our console to  see how v-once works the image below illustrates so:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q4wSnV8_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0yhok5d0570mxfc6lsnf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q4wSnV8_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0yhok5d0570mxfc6lsnf.png" alt="without v-once" width="616" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above is how v-once is used as shown in the image even after the value was changed the tag that has v-once it is not rerendered again.&lt;/p&gt;

&lt;h4&gt;3.v-cloak&lt;/h4&gt;

&lt;p&gt;To illustrate v-cloak maybe a little hard.but as you are developing your app and refreshing the browser to see the output in a short moment you can see the Mustachetag or  any other vue component .So to handle this we use v-cloak on our parent div  also the directive doesn't have v-attribute and v-argument . After this in your css workspace do the following&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    //vue workspace

    &amp;lt;div class="container" v-cloak&amp;gt;
        //Here other property
    &amp;lt;/div&amp;gt;

    //Css workspace
    [v-cloak]{
        display:none;
    }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Doing in so the output will be displayed once processing or compilinga is done.&lt;/p&gt;

&lt;h4&gt;4.v-pre&lt;/h4&gt;

&lt;p&gt;Due to the fast compilation of vue maybe unable to illustrate but this directive purpose is if there are elements that are static instead for compiling them over and over again and there are not part or used by vue to skip them . Also it is the same for (v-once,v-cloak) no attribute name or argument&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    &amp;lt;h2 v-pre&amp;gt;This is a static paragraph&amp;lt;/h2&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This snippet will not be compiled.&lt;/p&gt;

&lt;h4&gt;5.v-bind or : for shorthand&lt;/h4&gt;

&lt;p&gt;This is one of important directive in vue as name says binds vue data to html elements attribute&lt;br&gt;
example:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

     &amp;lt;div id="app"&amp;gt;
        &amp;lt;h2&amp;gt;`{{ title }}`&amp;lt;/h2&amp;gt;
        &amp;lt;h2  v-text="text"&amp;gt;&amp;lt;/h2&amp;gt;
        &amp;lt;h1 v-html="html"&amp;gt;&amp;lt;/h1&amp;gt;
        &amp;lt;h2 v-once  v-text="vonce"&amp;gt;&amp;lt;/h2&amp;gt;
        &amp;lt;h2&amp;gt;`{{ vonce}}` don't have v-once&amp;lt;/h2&amp;gt;
        &amp;lt;a v-bind:href="link" target="_blank"&amp;gt;My linked in profile&amp;lt;/a&amp;gt;
        &amp;lt;br&amp;gt;
        &amp;lt;a :href="link" target="_blank"&amp;gt;My linked in profile&amp;lt;/a&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
       let app= Vue.createApp({
            data() {
                return {
                    title:"Illustrating v-html",
                    text: "Illustrating v-text",
                    html: "&amp;lt;h1&amp;gt;This is heading&amp;lt;/h1&amp;gt;",
                     link: "https://www.linkedin.com/in/kelvingithu/",
                    vonce: "This is v-once that renders once  only"
                }
            }
        });

        let vm = app.mount("#app");
    &amp;lt;/script&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lets focus on this snippet of part of above snippet&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

     &amp;lt;a v-bind:href="link" target="_blank"&amp;gt;My linked in profile&amp;lt;/a&amp;gt;
        &amp;lt;br&amp;gt;
        &amp;lt;a :href="link" target="_blank"&amp;gt;My linked in profile&amp;lt;/a&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using v-bind  or : for shorthand we can pass link value that is data value of vue to our anchor tag  as  shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kfy_lItx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tst17190pe2u32igfogl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kfy_lItx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tst17190pe2u32igfogl.png" alt="elements" width="800" height="583"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the image above illustrate  we can have passed  this &lt;a href="https://www.linkedin.com/in/kelvingithu/"&gt;https://www.linkedin.com/in/kelvingithu/&lt;/a&gt; to the href attribute .&lt;br&gt;
The v-bind or : can be used to pass or bind vue data to any html attribute that needs an argument eg src,href,classes,ids and many more.&lt;/p&gt;

&lt;h4&gt;6.v-on&lt;/h4&gt;

&lt;p&gt;To illustrate this well will be on the methods since v-on is an event listener like &lt;b&gt;click,mouseover,input and many more&lt;/b&gt;  it has a shorthand for @ .&lt;b&gt;@&lt;/b&gt; is it's shorthand&lt;/p&gt;

&lt;h4&gt;7.v-is&lt;/h4&gt;

&lt;p&gt;This  changes a HTML tag from one to another it is working but it is deprecated as of vue 3.1&lt;br&gt;
example:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    &amp;lt;div id="app"&amp;gt;
        &amp;lt;h2 v-is="`p`"&amp;gt;`{{ title }}`&amp;lt;/h2&amp;gt;
    &amp;lt;/div&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GR0iCNPc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jo3bqx1orbhk0k5ju2jz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GR0iCNPc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jo3bqx1orbhk0k5ju2jz.png" alt="v-is" width="753" height="764"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As image above shows the h2 was changed to p tag.&lt;/p&gt;

&lt;h4&gt;8.v-model&lt;/h4&gt;

&lt;p&gt;Another important directive must know.&lt;br&gt;
It creates two way data  binding to collect and display the output to the user through the input tag. More understanding is when taking user inputs&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    &amp;lt;div id="app"&amp;gt;
    &amp;lt;input type="text" v-model="username"&amp;gt;

    &amp;lt;/div&amp;gt;
    &amp;lt;script src="https://unpkg.com/vue@next"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
    let app = Vue.createApp({
        data(return{
            username:''
        })
    })
    &amp;lt;/script&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code if user enters any value that value can be accessible in dat in vue in username also it is the same if there is value in username it will be accesible to the user that is two way data binding.&lt;/p&gt;

&lt;h4&gt;9.v-for&lt;/h4&gt;

&lt;p&gt;This for printing arrays and object to our DOM.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

       &amp;lt;div id="app"&amp;gt;
        &amp;lt;!-- v-for  in array --&amp;gt;
        &amp;lt;h2 style="color:#ad0889e3"&amp;gt;`{{title}}`&amp;lt;/h2&amp;gt;
        &amp;lt;p style="color:rgba(189, 16, 16, 0.932)"&amp;gt;v-for in array&amp;lt;/p&amp;gt;
       &amp;lt;ul &amp;gt;
        &amp;lt;li v-for="(elem,index) in cities" :key="index" :ref="`li`+index"&amp;gt;
            `{{elem}}`
        &amp;lt;/li&amp;gt;
       &amp;lt;/ul&amp;gt;
       &amp;lt;!-- v-for in objects --&amp;gt;
       &amp;lt;p style="color:rgba(0, 0, 0, 0.932)"&amp;gt;v-for in object&amp;lt;/p&amp;gt;
       &amp;lt;ul&amp;gt;
        &amp;lt;li v-for="(val,prop,index) in car" :key="index" &amp;gt;
            `{{index}}` `{{prop}}` `{{val}}`

        &amp;lt;/li&amp;gt;
       &amp;lt;/ul&amp;gt;
         &amp;lt;!-- v-for in json --&amp;gt;
            &amp;lt;p style="color:rgba(162, 165, 9, 0.932)"&amp;gt;v-for in json&amp;lt;/p&amp;gt;
            &amp;lt;ul&amp;gt;
                &amp;lt;li v-for="(elem,index) in json" :key="index"&amp;gt;
                    `{{index}}` `{{elem.Brand}}` `{{elem.model}}` `{{elem.year}}`
                &amp;lt;/li&amp;gt;
            &amp;lt;/ul&amp;gt;

            &amp;lt;!-- v-for if the json has diferrrent values --&amp;gt;
            &amp;lt;ul v-for="(elem,index) in cars" :key="index"&amp;gt;
                &amp;lt;li v-for="(val,prop,index) in elem" :key="idex"&amp;gt;
                    `{{prop}}`:`{{val}}`
                &amp;lt;/li&amp;gt;
            &amp;lt;/ul&amp;gt;

    &amp;lt;/div&amp;gt;
    &amp;lt;script src="./index.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
        const app = Vue.createApp({
            data(){
                return{
                    title:'v-for:iterate over[]  or {}',
                    cities:['Dhaka','Chittagong','Rajshahi','Khulna','Barishal','Sylhet','Rangpur','Mymensingh'],
                    json:[
                        {Brand:'Toyota',model:'Supra',year:2002},
                        {Brand:'Mercedes',model:'Amg',year:2011},
                        {Brand:'Honda',model:'NSX',year:2014},
                        {Brand:'Nissan',model:'GT-R',year:2017},
                        {Brand:'Toyota',model:'Camry',year:2014},
                        {Brand:'Mercedes',model:'G-wagon',year:205},
                        {Brand:'Honda',model:'Civic',year:2010},
                        {Brand:'Nissan',model:'Nism0',year:2019},
                    ],
                    car:{Brand:'Nissan',model:'GT-R32',year:2013}, 
                    cars:[
                    {Brand:'Nissan',model:'GT-R32',year:2013},
                    {Brand:'Nissan',model:'GT-R35',owner:"kelvin"},
                    {Brand:'Toyota ',owner:'Nash',price:"30m"}
                    ],
                     link: "https://www.linkedin.com/in/kelvingithu/"



                }
            }
        })
            let vm = app.mount("#app")

    &amp;lt;/script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output for the code&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U5A_zO05--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cr3byxaz1r0we5nf8te8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U5A_zO05--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cr3byxaz1r0we5nf8te8.png" alt="v-for" width="557" height="706"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;10.Conditional Rendering&lt;/h2&gt;

&lt;p&gt;conditional rendering use v-directive of v-if ,v-else-if and v-else.&lt;br&gt;
Note to take home is that when using this directive they should be adjancent to each other and no other elements should appear  between them or else it will not work.&lt;br&gt;
Example:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

      &amp;lt;div id="app"&amp;gt;
        &amp;lt;p v-if="val"&amp;gt;This an Even number&amp;lt;/p&amp;gt;
        &amp;lt;p v-else&amp;gt;This is an odd number&amp;lt;/p&amp;gt;

        &amp;lt;p v-if="fruit==='banana'"&amp;gt;This a banana&amp;lt;/p&amp;gt;
        &amp;lt;p v-else-if="fruit==='apple'"&amp;gt;This an apple&amp;lt;/p&amp;gt;
        &amp;lt;p v-else&amp;gt;This is another fruit&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;script src="./index.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
       let app= Vue.createApp({
            data() {
                return {

                    val:true,
                    fruit:'banana'
                }
            }
        });

        let vm = app.mount("#app");
    &amp;lt;/script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lets start with  this code block&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    &amp;lt;p v-if="val"&amp;gt;This an Even number&amp;lt;/p&amp;gt;
    &amp;lt;p v-else&amp;gt;This is an odd number&amp;lt;/p&amp;gt;    

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code block above we pass val data from vue that is true.we could have passed it directly but the reason behind this is :-&lt;br&gt;
    1.To show we can pass vue data&lt;br&gt;
    2.To change the value to see the conditional rendering&lt;br&gt;
Lets see the output :-&lt;br&gt;
image below is when we compile our code since val is true will print first p tag with This is an even number&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JdLFZlNT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fvpqcjtfuirrojau0jie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JdLFZlNT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fvpqcjtfuirrojau0jie.png" alt="even" width="549" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now lets change the value of val to false in the console here it is the output:-it will print second tag with This an odd number&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--31HlOeAo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/v1/./images/odd.png" class="article-body-image-wrapper"&gt;&lt;img alt="odd" src="https://res.cloudinary.com/practicaldev/image/fetch/s--31HlOeAo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/v1/./images/odd.png" width="" height=""&gt;&lt;/a&gt;&lt;br&gt;
lets inspect the second block which have v-if,v-else-if,v-else:-&lt;br&gt;
The purpose of this is to show we can do simple js code in these v-directives to compare&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

      &amp;lt;p v-if="fruit==='banana'"&amp;gt;This a banana&amp;lt;/p&amp;gt;
        &amp;lt;p v-else-if="fruit==='apple'"&amp;gt;This an apple&amp;lt;/p&amp;gt;
        &amp;lt;p v-else&amp;gt;This is another fruit&amp;lt;/p&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here it is the output:-&lt;/p&gt;

&lt;p&gt;As fruit is set to banana it will output This is a banana.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hYdzqgsp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jcz3vms262fd4clznxsu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hYdzqgsp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jcz3vms262fd4clznxsu.png" alt="default" width="360" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we change the value of the fruit to apple in the console the output will be This is an apple&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rmg1v7Yh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2d96gt3p9s8rba1rccle.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rmg1v7Yh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2d96gt3p9s8rba1rccle.png" alt="apple" width="345" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we change the value of the fruit to another fruit lets say kiwi in the console the output will be This is an another fruit&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PMY18jJj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zkwpbzt638kdjmkfyaim.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PMY18jJj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zkwpbzt638kdjmkfyaim.png" alt="kiwi" width="569" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another keynote to add is that in v-if,v-else-if,v-else it completely removes the element from DOM .&lt;/p&gt;

&lt;h4&gt;11.v-show&lt;/h4&gt;

&lt;p&gt;This v-directive adds a styling of display:none to the element it  doesn't remove the element form the DOM. If false else if the argument returns true it removes the styling&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

       &amp;lt;p v-show="false"&amp;gt;This will not show&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
       let app= Vue.createApp({
            data() {
                return {

                }
            }
        });

        let vm = app.mount("#app");
    &amp;lt;/script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As the image below  shows &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E4XK_eFh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m2c17vrper04pwr54usn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E4XK_eFh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m2c17vrper04pwr54usn.png" alt="v-show" width="736" height="603"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;it adds the styling of display none to our paragraph.That is how v-show  works.&lt;/p&gt;

&lt;h2&gt;ref and $refs &lt;/h2&gt;

&lt;p&gt;ref and $ref works like ids but in more use case it can be illustrated by using child component passing them to parent component and retrieving them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

     &amp;lt;div id="app"&amp;gt;
        &amp;lt;h2 ref="title"  v-if="control" id='title'&amp;gt;`{{title}}`&amp;lt;/h2&amp;gt;
        &amp;lt;p ref="msg" id="msg"&amp;gt;`{{msg}}`&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;

    &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
        const app = Vue.createApp({
            data(){
                return{
                    title:"Ref Attribute &amp;amp; vm.$refs",
                    msg:"access page elem. $ child comp",
                    control:true
                }
            }

        })
            let vm = app.mount("#app")
            let  h2 = vm.$refs.title

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;$refs-&amp;gt; This is vue keyword  that has all ref&lt;br&gt;
ref-&amp;gt; we create ref as shown in the code below we use ref="any value"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    &amp;lt;h2 ref="title"  v-if="control" id='title'&amp;gt;`{{title}}`&amp;lt;/h2&amp;gt;
        &amp;lt;p ref="msg" id="msg"&amp;gt;`{{msg}}`&amp;lt;/p&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Images below we can see that we have access or we have or p and h2&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tZ4OCWz---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vzmm669prfbuycq5m0d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tZ4OCWz---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vzmm669prfbuycq5m0d.png" alt="ref attribute" width="800" height="225"&gt;&lt;/a&gt;&lt;br&gt;
This image below we can even console the whole tag with it value&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gzS8ZwVN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bsnoe59krjofl2dz3eif.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gzS8ZwVN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bsnoe59krjofl2dz3eif.png" alt="h2ref" width="800" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Happy Developing .Bug free Codes😎😋&lt;/b&gt;&lt;/p&gt;

&lt;h3&gt;Next stage is &lt;strong&gt;Computed, Methods, and Handling Forms&lt;/strong&gt;
&lt;/h3&gt;

</description>
      <category>webdev</category>
      <category>vue</category>
      <category>javascript</category>
    </item>
    <item>
      <title>My first progress in learning Vue.js</title>
      <dc:creator>Githu Kelvin</dc:creator>
      <pubDate>Tue, 30 May 2023 14:41:47 +0000</pubDate>
      <link>https://dev.to/githukelvin/my-first-progress-in-learning-vuejs-1ldg</link>
      <guid>https://dev.to/githukelvin/my-first-progress-in-learning-vuejs-1ldg</guid>
      <description>&lt;p&gt;Today  As the First Day of learning  of Vue.js What i started with is the reactivity of  Vue.js 2 and reactivity of Vue 3.&lt;/p&gt;

&lt;p&gt;1.Vue 2 Reactivity&lt;br&gt;
 It works using setter and getter function that are  passed as in an object as arguments of    Object.defineproperty();&lt;br&gt;
 &lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Object.defineProperty(info,"reactive_msg",//proxy for the info.msg
    {
        get(){
            return info.msg
        },
        set(newValue){

            info.msg = newValue;
            document.getElementById("h1").innerText= newValue;
        },

    })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The Object.definePropety()-&amp;gt;Accepts two  values 1. The target object 2. Name of the new value 3.An object  with the getter and setter object.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rcO8tIlX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qj33pi6spz545zwoevi7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rcO8tIlX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qj33pi6spz545zwoevi7.png" alt="Image above showing the page showing vue 2 reactivity" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;
Image above showing the page showing vue 2 reactivity



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--StQrQ8Nn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lxsm0sbobk5dr5p5n8vz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--StQrQ8Nn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lxsm0sbobk5dr5p5n8vz.png" alt="Image showing the content of the info object  after define object  property" width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;
Fig.1. Image showing the content of the info object  after define object  property



&lt;p&gt;So  with this it is clear  that vue.js 2  works  with the usage  using setter and getter defined  in the object.defineproperty();&lt;/p&gt;

&lt;p&gt;In Vue 3 to implement  reactivity it  use the proxy constructor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

       let info_proxy = new Proxy(info ,{
        get(target,prop,receiver){
            if(typeof target[prop] == 'string' ){
              target[prop] = target[prop] + ' returned by proxy getter';
            }
            return Reflect.get(...arguments);
        },
        set(target,prop,newVal,receiver){
            if(typeof newVal == 'string'){
                newVal = newVal + ' returned by proxy setter';
            }
            document.getElementById("h1").innerText = newVal;
           Reflect.set(...arguments)
        },
        }
          )


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Proxy Constructor Accepts  2  values 1. The target object 2. Object with getter and setter &lt;br&gt;
The getter function accepts 3 arguments 1.The target,2. Prop,3.Receiver&lt;br&gt;
The setter function accepts 4 arguments 1.The target,2. Prop,3.the newval 4.receiver-&amp;gt;as Name suggest the receiver of the new value&lt;br&gt;
The Reflect.get()  or Reflect.set() it is used to return our outputs as expected &lt;br&gt;
To learn more about them follow this link &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect"&gt;Reflect Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aeKDnyd6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bngit7zl6t4czcochyr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aeKDnyd6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bngit7zl6t4czcochyr.png" alt="info_proxy" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;
Fig.2. Image showing console of the info_proxy



&lt;p&gt;In Fig.2  as you can see the console it displays handler and target array  the handler array contains&lt;br&gt;
the setter and getter function &lt;/p&gt;

&lt;p&gt;the target it contains the target in our case the msg in our info object.&lt;br&gt;
As explained above  below it is the display of our expanded info_proxy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4zUGNRrq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5wewbrfccldn4awz7ic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4zUGNRrq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5wewbrfccldn4awz7ic.png" alt="Image showing the info_proxy object" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;
Fig.3. Image showing the info_proxy object



&lt;p&gt;Vue 3 implementation  it use proxy to create and update our dom as  shown  below  as we run the instance of our app for the below implementation&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

 &amp;lt;script src="https://unpkg.com/vue@3/dist/vue.global.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
     let app =   Vue.createApp({

        //options object

        })
        //mount
       let vm = app.mount('#app');

    &amp;lt;/script&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we console vm in our browser below is the output&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uOtPNScP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7xir5dgqeneshpnkp80x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uOtPNScP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7xir5dgqeneshpnkp80x.png" alt="Image showing console of the vm" width="800" height="136"&gt;&lt;/a&gt;&lt;/p&gt;
Fig.4. Image showing console of the vm



&lt;p&gt;The image fig.4 and image fig.2  there are the same where  we used proxy constructor&lt;br&gt;
It  has the handler and target  as the same for our constructor in fig.2&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--df0WTtYD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/655ajxdatmf7sg7q5ajn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--df0WTtYD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/655ajxdatmf7sg7q5ajn.png" alt="Image showing the handler object" width="800" height="221"&gt;&lt;/a&gt;&lt;/p&gt;
Fig.5. Image showing the handler object



&lt;p&gt;Fig.5 shows us our get and set as same in our proxy constructor&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MzLWwrdx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9u5yruznl3otlb4bz1s6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MzLWwrdx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9u5yruznl3otlb4bz1s6.png" alt="showing the expanded vm object" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;
Fig.6. Image showing the expanded vm object



&lt;p&gt;As the figure above shows our target has more values than our proxy constructor and this is because we have targets that are already define as the same in our msg in info object in our proxy constructor&lt;/p&gt;

&lt;p&gt;This is my first progress exploring Vue.js &lt;br&gt;
Next lesson is learning about directives of vue.js&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>vue</category>
    </item>
  </channel>
</rss>
