<?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: Alejandro Sierra</title>
    <description>The latest articles on DEV Community by Alejandro Sierra (@alejandro_sierra).</description>
    <link>https://dev.to/alejandro_sierra</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%2F254164%2Fa471edf0-4ca6-421c-9a44-cfde64e88b03.jpeg</url>
      <title>DEV Community: Alejandro Sierra</title>
      <link>https://dev.to/alejandro_sierra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alejandro_sierra"/>
    <language>en</language>
    <item>
      <title>Find The commit that introduced a bug with git bisect</title>
      <dc:creator>Alejandro Sierra</dc:creator>
      <pubDate>Fri, 27 Mar 2020 02:08:42 +0000</pubDate>
      <link>https://dev.to/alejandro_sierra/find-the-commit-that-introduced-a-bug-with-git-bisect-2jgi</link>
      <guid>https://dev.to/alejandro_sierra/find-the-commit-that-introduced-a-bug-with-git-bisect-2jgi</guid>
      <description>&lt;h2&gt;
  
  
  Picture yourself in this scenario
&lt;/h2&gt;

&lt;p&gt;You’ve been working on a branch for the past 3 days. 30 commits later you are ready to complete your feature when all of a sudden. You realize that something is wrong with the footer of your application. As you panic, you look at your previous commits to see if anything has changed in the footer. In fact, the footer has not been touched and you have no idea what’s going on. &lt;/p&gt;

&lt;p&gt;With &lt;code&gt;git bisect&lt;/code&gt; you could save countless hours of trying to find the exact commit that introduced the bug, without having to go commit by commit.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git bisect&lt;/code&gt; will perform a binary search to help you find the exact commit you’re looking for. If you are unfamiliar with a binary search it basically means it will divide the options in half each time as you answer a simple question &lt;em&gt;Does the commit that it is showing you have the bug or not&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8h3qq3bbc2zsbl0tlkil.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8h3qq3bbc2zsbl0tlkil.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How To use
&lt;/h2&gt;

&lt;p&gt;Now, to start the process use &lt;code&gt;git bisect start&lt;/code&gt;. After doing this nothing happens... What you then need to do is supply git with a commit that you know where the bug not present or a ‘good’ commit  &lt;code&gt;git bisect good ch4792h2&lt;/code&gt; for example. Then enter the second commit which has a known instance of the app with the bug, in other words, a ‘bad commit’ such as &lt;code&gt;git bisect bad ke37lw5&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After doing this git will checkout a commit for you that you will then have to respond with &lt;code&gt;git bisect good&lt;/code&gt; if the commit it's showing you does not have the bug or &lt;code&gt;git bisect bad&lt;/code&gt; if it does. After answering, git will narrow the search by removing the other half of the commits, then asking you the same question. Eventually narrowing down to the commit that introduced the bug.&lt;/p&gt;

&lt;p&gt;And that’s it! In about 4 to 5 commits you were able to find the commit that introduced the bug. Now, this might be more beneficial for checking for changes in the UI since you can clearly see when something in the app is not working like its supposed to. However, it is a nice command to remember from time to time if something ever comes up&lt;/p&gt;

&lt;p&gt;&lt;a href="https://git-scm.com/docs/git-bisect" rel="noopener noreferrer"&gt;Git Bisect Docs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Reusable components with scoped slots in vue</title>
      <dc:creator>Alejandro Sierra</dc:creator>
      <pubDate>Sun, 03 Nov 2019 20:15:07 +0000</pubDate>
      <link>https://dev.to/alejandro_sierra/reusable-components-with-scoped-slots-in-vue-42lp</link>
      <guid>https://dev.to/alejandro_sierra/reusable-components-with-scoped-slots-in-vue-42lp</guid>
      <description>&lt;h2&gt;
  
  
  What are slots first of all?
&lt;/h2&gt;

&lt;p&gt;If you are not familiar with slots in Vue I suggest looking at the &lt;a href="https://dev.to%E2%88%9A"&gt;slots documentation&lt;/a&gt;  in short, slots in Vue are a way to pass markup into a component directly from the parent to child component&lt;/p&gt;

&lt;h2&gt;
  
  
  So, what’s a scoped slot?
&lt;/h2&gt;

&lt;p&gt;Scoped slots allow us to take this one step further by allowing data in the child component to be used by the parent. In turn, allowing the content to be displayed differently&lt;/p&gt;

&lt;p&gt;This can be helpful when creating a reusable component that shares functionality but needs different variations of UI. &lt;/p&gt;

&lt;p&gt;Let's take a look at an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;// photo-gallery component
&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;{{title}}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"photo-gallery"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;slot&lt;/span&gt; &lt;span class="na"&gt;v-bind:items=&lt;/span&gt;&lt;span class="s"&gt;"photos"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/slot&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;

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



&lt;p&gt;imagine that this component is called &lt;code&gt;photo-gallery&lt;/code&gt; its job is to retrieve data from a photos API and store it in a piece of local data called &lt;code&gt;photos&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// template for photo-gallery...&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;photos&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;  
            &lt;span class="p"&gt;.....&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;we set up the outline by defining all the things we want any instances of photo-gallery to share. Such as having a title and a gallery container with custom styling.&lt;/p&gt;

&lt;p&gt;When we use this component we have access to its photos using the &lt;code&gt;items&lt;/code&gt; property that was defined in &lt;code&gt;v-bind:items=“photos”&lt;/code&gt;  basically saying “pass the photos as &lt;code&gt;items&lt;/code&gt; “.&lt;/p&gt;

&lt;p&gt;When you use this component now it looks like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;photo-gallery&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;v-slot=&lt;/span&gt;&lt;span class="s"&gt;"props"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;ul&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"alt-gallery"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"alt-photo"&lt;/span&gt;&lt;span class="err"&gt;&lt;/span&gt; &lt;span class="na"&gt;v-for&lt;/span&gt;&lt;span class="err"&gt;"&lt;/span&gt;&lt;span class="na"&gt;item&lt;/span&gt; &lt;span class="na"&gt;in&lt;/span&gt; &lt;span class="na"&gt;props.items&lt;/span&gt;&lt;span class="err"&gt;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/photo-gallery&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We are given access to the photos by using &lt;code&gt;v-slot=“items”&lt;/code&gt;  then we loop over each photo or “item” and create a  &lt;code&gt;alt-photo&lt;/code&gt; list item.&lt;/p&gt;

&lt;p&gt;Using this approach we can create multiple instances of the photo-gallery and can even make components for each instance like &lt;code&gt;gallery-list&lt;/code&gt; and &lt;code&gt;alt-gallery&lt;/code&gt;  while passing the photos array into them like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;photo-gallery&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;v-slot=&lt;/span&gt;&lt;span class="s"&gt;"props"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;gallery-list&lt;/span&gt;
            &lt;span class="na"&gt;:photos=&lt;/span&gt;&lt;span class="s"&gt;"props.items"&lt;/span&gt;
        &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/photo-gallery&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Takeaways:&lt;br&gt;
Using scoped slots, we delegate common functionality and markup to the scoped component. Then on each instance, we can change the way our data is represented visually.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots"&gt;Slots — Vue.js&lt;/a&gt;&lt;br&gt;
&lt;a href="https://css-tricks.com/using-scoped-slots-in-vue-js-to-abstract-functionality/"&gt;cover image&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>components</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Vue Event And Key Modifiers</title>
      <dc:creator>Alejandro Sierra</dc:creator>
      <pubDate>Mon, 21 Oct 2019 13:30:35 +0000</pubDate>
      <link>https://dev.to/alejandro_sierra/vue-event-and-key-modifiers-307e</link>
      <guid>https://dev.to/alejandro_sierra/vue-event-and-key-modifiers-307e</guid>
      <description>&lt;h2&gt;
  
  
  What are they?
&lt;/h2&gt;

&lt;p&gt;Event and Key modifiers allow you to add event functionality directly inline where you define your template. This can help you write cleaner and more accessible code to your site with minimum effort.&lt;/p&gt;

&lt;p&gt;let's look at a quick example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"anchorAction"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click for a free rtx 2080&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Let's say you're using an anchor tag as a trigger for something on your page but you're not linking to another site or page. You know that clicking on it will instantly go to the top of the page so you need to &lt;code&gt;preventDefault()&lt;/code&gt; behavior. Because of this, you add the usual &lt;code&gt;event.preventDefault()&lt;/code&gt; to your anchorAction method in your &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;anchorAction&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="c1"&gt;// other logic&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;    

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



&lt;p&gt;This is business as usual but in Vue you don't need to do this. You can just add this instead&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click.prevent=&lt;/span&gt;&lt;span class="s"&gt;"anchorAction"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click for a free Rtx 2080&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;.prevent&lt;/code&gt; will add the code you just did in your anchorAction method&lt;/p&gt;

&lt;p&gt;So this saves you the trouble of having to write &lt;code&gt;event.preventDefault()&lt;/code&gt; in your component which might not be that big of a deal but let's look at another example of modifiers implemented in a modal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"overlay"&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"closeModal"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"modal"&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click.stop&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            modal content
        &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;@click="closeModal"&lt;/code&gt; line would close the modal however, we don't want to close it when we click inside of the modal so we stop propagation.&lt;br&gt;
You do not even need to have a method attached to the click event to add the event. All that was added was just &lt;code&gt;@click.stop&lt;/code&gt; and it saves you from having to write an entire method just to do this.&lt;/p&gt;
&lt;h2&gt;
  
  
  available modifiers
&lt;/h2&gt;

&lt;p&gt;Vue has more but these are some common ones you might use&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.stop&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;By default, clicking on an element will also click on its parent elements. using this will only click on itself and call any methods on the specific element&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;.prevent&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;prevents default behaviour in an event such as submitting a form on input click.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;.capture&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Will trigger any parent methods before the child or target elements method ( Capturing phase )&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;.once&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allows method in click to only happen once on that element ( Will reset after the element is destroyed )&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Chaining modifiers
&lt;/h2&gt;

&lt;p&gt;You also have the option to chain some of these events modifiers&lt;/p&gt;

&lt;p&gt;@click.stop.prevent&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;will stop propagation and prevent default behaviour&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  key modifiers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;@keydown.enter&lt;/li&gt;
&lt;li&gt;@keyup.esc&lt;/li&gt;
&lt;li&gt;@click.ctrl&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where we can add these events to add extra functionality for accessibility to our sites.&lt;/p&gt;

&lt;p&gt;For example, if you are creating a custom drop-down element that needs to have native functionality like the select element, We can add key events inline. This would remove the need for extra if statements checking for keyCodes in our logic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"myCustomSelect"&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;keyup.enter=&lt;/span&gt;&lt;span class="s"&gt;"toggleSelect"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Item 1&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Item 1&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And just like that, you can add native functionality for your keyboard users. You could even add some more key events such as &lt;code&gt;arrowup&lt;/code&gt; and &lt;code&gt;arrowdown&lt;/code&gt; for going through the menu items.&lt;/p&gt;

&lt;p&gt;Vue has tons of features to make your life as a developer easier by cleaning up your components, And if you have not done so already I highly recommend reading through the Vue documentation for more great examples.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vuejs.org/"&gt;Vue Docs&lt;/a&gt;&lt;br&gt;
&lt;a href="https://vuejs.org/v2/guide/events.html#Event-Modifiers"&gt;Vue Event Modifiers&lt;/a&gt;&lt;/p&gt;

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