<?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: Jordan Kicklighter</title>
    <description>The latest articles on DEV Community by Jordan Kicklighter (@jwkicklighter).</description>
    <link>https://dev.to/jwkicklighter</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%2F63925%2Fa2c64b77-6bb5-4968-95a4-f3e1a5746447.jpg</url>
      <title>DEV Community: Jordan Kicklighter</title>
      <link>https://dev.to/jwkicklighter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jwkicklighter"/>
    <language>en</language>
    <item>
      <title>What are your go-to tech podcasts?</title>
      <dc:creator>Jordan Kicklighter</dc:creator>
      <pubDate>Fri, 18 Dec 2020 15:27:42 +0000</pubDate>
      <link>https://dev.to/jwkicklighter/what-are-your-go-to-tech-podcasts-117m</link>
      <guid>https://dev.to/jwkicklighter/what-are-your-go-to-tech-podcasts-117m</guid>
      <description>&lt;p&gt;To get the ball rolling, here are some of my favorites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://bikeshed.fm" rel="noopener noreferrer"&gt;The Bike Shed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://syntax.fm" rel="noopener noreferrer"&gt;Syntax&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://changelog.com" rel="noopener noreferrer"&gt;The Changelog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  The Bike Shed
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;On The Bike Shed, hosts Chris Toomey &amp;amp; Steph Viccari discuss their development experience and challenges at thoughtbot with Ruby, Rails, JavaScript, and whatever else is drawing their attention, admiration, or ire this week.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Bike Shed is a podcast sponsored by thoughtbot, run by thoughtbotters, talking about tech challenges encountered during the work week. I've gained insight into so many technologies from just listening to Chris and Steph chat about topics that showed up during their development week. Conversation often involves Rails and JS, but nothing is off-limits. Elm and Scala have come up a number of times.&lt;/p&gt;

&lt;h1&gt;
  
  
  Syntax
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;A Tasty Treats Podcast for Web Developers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hostedy by Wes Bos and Scott Tolinski, Syntax is a podcast for learning about new things in web development. Since Wes and Scott are both educational content creators, episodes vary from topic introductions to somewhat deep dives on more specific concepts. Definitely less "in-the-weeds" than The Bike Shed, which isn't really a good or bad thing.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Changelog
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;Conversations with the hackers, leaders, and innovators of the software world&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Episodes of The Changelog are generally setup as conversations with interesting people from the tech industry. From developer relations experts to software architects, you may not enjoy the guest of every episode, but there are almost definitely some that will pique your interest.&lt;/p&gt;

&lt;h1&gt;
  
  
  What do you listen to?
&lt;/h1&gt;

&lt;p&gt;These are a few tech shows in my podcast player, what's in yours?&lt;/p&gt;




&lt;p&gt;&lt;span&gt;Photo by &lt;a href="https://unsplash.com/@intelligenciya?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Alexey Ruban&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/audio?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>Pass props to dynamic Vue components</title>
      <dc:creator>Jordan Kicklighter</dc:creator>
      <pubDate>Fri, 04 Sep 2020 17:20:00 +0000</pubDate>
      <link>https://dev.to/jwkicklighter/pass-props-to-dynamic-vue-components-5h7k</link>
      <guid>https://dev.to/jwkicklighter/pass-props-to-dynamic-vue-components-5h7k</guid>
      <description>&lt;p&gt;&lt;em&gt;This article is also posted on my &lt;a href="https://jwkicklighter.com/posts/pass-props-to-dynamic-vue-components/" rel="noopener noreferrer"&gt;blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;While brainstorming some new Vue components (that sounds &lt;a href="https://jwkicklighter.com/posts/pass-all-props-to-children-in-vue/" rel="noopener noreferrer"&gt;familiar&lt;/a&gt;), I thought it would be nice to loop over a list of items and dynamically render the correct component for each one. The problem is that the components being rendered do not take the same props.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclaimer: this article is a bit more complicated than my last one. I assume that you understand the basics of Vue components and that you have some knowledge of modern JS patterns such as &lt;code&gt;Array.map&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In Vue, it's very common to loop over a list of items and render a component for each item. This is usually done by specifying the component that will be rendered and adding a &lt;code&gt;v-for&lt;/code&gt; to its tag in the template.&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;!-- Contacts.vue --&amp;gt;
&amp;lt;template&amp;gt;
  &amp;lt;contact-card
    v-for="person in people"
    :key="person.id"
    :contact="person" /&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
  import ContactCard from 'ContactCard.vue'

  export default {
    components: {
      ContactCard,
    },
    props: {
      people: {
        type: Array,
        default: () =&amp;gt; [],
      }
    }
  }
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a very straightforward pattern seen often in Vue apps. In the example above, we have a component &lt;code&gt;ContactCard&lt;/code&gt; that is meant to display a person's contact information. Let's take a closer look at &lt;code&gt;ContactCard.vue&lt;/code&gt; to get a feel for what's going on.&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;!-- ContactCard.vue --&amp;gt;
&amp;lt;template&amp;gt;
  &amp;lt;article&amp;gt;
    &amp;lt;h1&amp;gt;{{ contact.name }}&amp;lt;/h1&amp;gt;
    &amp;lt;ul&amp;gt;
      &amp;lt;li&amp;gt;Phone: {{ contact.phone }}&amp;lt;/li&amp;gt;
      &amp;lt;li&amp;gt;Email: {{ contact.email }}&amp;lt;/li&amp;gt;
    &amp;lt;/ul&amp;gt;
  &amp;lt;/article&amp;gt;
&amp;lt;/template&amp;gt;
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So as you can see, we have a very basic component for displaying details of a contact. The root level is an article tag (yay HTML5) with an h1 tag containing the person's name and an unordered list of some contact information. Nothing crazy, but there is a required prop called &lt;code&gt;contact&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Dynamic Components
&lt;/h1&gt;

&lt;p&gt;As we build more of the app, we get the idea to add a timeline that shows the order that data was added to the system, which includes creating contacts. Because we already have such a robust component for displaying contact information, we decided to re-use it in this timeline view. Let's take a look at a new component for that.&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;!-- Timeline.vue --&amp;gt;
&amp;lt;template&amp;gt;
  &amp;lt;contact-card
    v-for="item in history"
    :key="item.id"
    :contact="item" /&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
  import { historyArray } from 'Data'
  import ContactCard from 'ContactCard.vue'

  export default {
    components: {
      ContactCard,
    },
    computed: {
      history () {
        return historyArray
      },
    },
  }
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first glance, the &lt;code&gt;Timeline&lt;/code&gt; component probably looks great. But let's look at the structure of &lt;code&gt;historyArray&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
  {
    id: 'contact-1',
    isContactItem: true,
    ...
  },
  {
    id: 'event-1',
    isSystemEventItem: true,
    ...
  },
  {
    id: 'contact-2',
    isContactItem: true,
    ...
  },
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A closer look reveals that there are more than just "contacts" in this historical data. Indeed, we have contacts &lt;strong&gt;and&lt;/strong&gt; system events to display. Luckily, someone has already created a &lt;code&gt;SystemEvent&lt;/code&gt; component so we don't have to. Much like our &lt;code&gt;ContactCard&lt;/code&gt; this component has a single required prop (&lt;code&gt;event&lt;/code&gt; in this case) and displays relevant information about that prop. So let's change the &lt;code&gt;Timeline&lt;/code&gt; component to dynamically decide which component to use for each item in the list.&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;!-- Timeline.vue --&amp;gt;
&amp;lt;template&amp;gt;
  &amp;lt;component
    v-for="item in history"
    :key="item.id"
    :is="item.component"
    :contact="item" /&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
  import { historyArray } from 'Data'
  import ContactCard from 'ContactCard.vue'
  import SystemEvent from 'SystemEvent.vue'

  export default {
    components: {
      ContactCard,
      SystemEvent,
    },
    computed: {
      history () {
        return historyArray.map(historyItem =&amp;gt; {
          if (historyItem.isContactItem) {
            // Return a new object that contains ALL keys
            // from `historyItem` and adds a `component` key
            return {
              ...historyItem,
              component: ContactCard,
            }
          } else if (historyItem.isSystemEventItem) {
            return {
              ...historyItem,
              component: SystemEvent,
            }
          }
        })
      },
    },
  }
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that instead of specifying &lt;code&gt;contact-card&lt;/code&gt; in the template, we are now using a special tag called &lt;code&gt;component&lt;/code&gt;. Along with this, there is a new &lt;code&gt;is&lt;/code&gt; prop being passed in. Inside of the &lt;code&gt;history&lt;/code&gt; computed value, we are checking each item to see if it is a contact or system event item (using some special helper functions that we assume exist), and we add the key &lt;code&gt;component&lt;/code&gt; that contains the relevant component to render for that particular item. In the loop within the template, the &lt;code&gt;is&lt;/code&gt; prop gets bound to that &lt;code&gt;component&lt;/code&gt; key. The end result is that contact items cause a &lt;code&gt;ContactCard&lt;/code&gt; component to be rendered and system event items cause a &lt;code&gt;SystemEvent&lt;/code&gt; component to be rendered.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: you can read up on the &lt;code&gt;component&lt;/code&gt; tag in the &lt;a href="https://vuejs.org/v2/guide/components.html#Dynamic-Components" rel="noopener noreferrer"&gt;Vue docs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you're paying close attention, you may notice a slight problem: the &lt;code&gt;SystemEvent&lt;/code&gt; component takes a prop called &lt;code&gt;event&lt;/code&gt;, but the template is currently passing it a prop called &lt;code&gt;contact&lt;/code&gt;. How can we get around that? Well one option is to pass both &lt;code&gt;contact&lt;/code&gt; and &lt;code&gt;event&lt;/code&gt; props to every component. This technically won't cause a problem, but it feels a bit messy. Regardless, let's see what that might look like.&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;!-- Timeline.vue --&amp;gt;
&amp;lt;template&amp;gt;
  &amp;lt;component
    v-for="item in history"
    :key="item.id"
    :is="item.component"
    :contact="item"
    :event="item" /&amp;gt;
&amp;lt;/template&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Now every component in the list will be passed &lt;code&gt;contact&lt;/code&gt; and &lt;code&gt;event&lt;/code&gt;. They are both being passed the same variable, so the &lt;code&gt;ContactCard&lt;/code&gt; component will see the &lt;code&gt;contact&lt;/code&gt; prop and behave correctly, and the &lt;code&gt;SystemEvent&lt;/code&gt; component will see the &lt;code&gt;event&lt;/code&gt; prop and behave correctly. This will work fine, but as you can imagine could quickly get out of hand if we have components with numerous props needed. There has to be a better way...&lt;/p&gt;

&lt;h1&gt;
  
  
  Dynamic Props
&lt;/h1&gt;

&lt;p&gt;Wait a minute! If we are dynamically declaring what &lt;em&gt;component&lt;/em&gt; is going to be rendered, can't we dynamically declare what &lt;em&gt;props&lt;/em&gt; that component should receive? If you read my &lt;a href="https://jwkicklighter.com/posts/pass-all-props-to-children-in-vue/" rel="noopener noreferrer"&gt;last Vue post&lt;/a&gt;, then you already know that &lt;code&gt;v-bind&lt;/code&gt; allows you to bind an entire set of props in one go. So let's see if we can apply that here.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: You can read more about passing an object's properties with &lt;code&gt;v-bind&lt;/code&gt; in the &lt;a href="https://vuejs.org/v2/guide/components-props.html#Passing-the-Properties-of-an-Object" rel="noopener noreferrer"&gt;Vue docs&lt;/a&gt;.&lt;/em&gt;&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;!-- Timeline.vue --&amp;gt;
&amp;lt;template&amp;gt;
  &amp;lt;component
    v-for="item in history"
    :key="item.id"
    :is="item.component"
    v-bind="item.props" /&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
  import { historyArray } from 'Data'
  import ContactCard from 'ContactCard.vue'
  import SystemEvent from 'SystemEvent.vue'

  export default {
    components: {
      ContactCard,
      SystemEvent,
    },
    computed: {
      history () {
        return historyArray.map(historyItem =&amp;gt; {
          if (historyItem.isContactItem) {
            // Return a new object that contains a `component`
            // key, an `id` key, and a `props` object
            return {
              id: historyItem.id,
              component: ContactCard,
              props: {
                contact: historyItem,
              },
            }
          } else if (historyItem.isSystemEventItem) {
            return {
              id: historyItem.id,
              component: ContactCard,
              props: {
                event: historyItem,
              },
            }
          }
        })
      },
    },
  }
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alright, I know the function for our &lt;code&gt;history&lt;/code&gt; computed value is starting to get crazy, but it's really not doing much. If it's hard to follow, here is an example of what the resulting data structure would look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
  {
    id: 'contact-1',
    component: ContactCard,
    props: {
      contact: {...}
    }
  },
  {
    id: 'event-1',
    component: SystemEvent,
    props: {
      event: {...}
    }
  },
  {
    id: 'contact-2',
    component: ContactCard,
    props: {
      contact: {...}
    }
  }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Take another look at the template now that you have an idea of how &lt;code&gt;history&lt;/code&gt; is structured. Notice that the &lt;code&gt;contact&lt;/code&gt; and &lt;code&gt;event&lt;/code&gt; props were removed, and we just have a single &lt;code&gt;v-bind&lt;/code&gt; instead. The value we give &lt;code&gt;v-bind&lt;/code&gt; is &lt;code&gt;item.props&lt;/code&gt;, which according to the snippet above, will contain the prop that is appropriate for each component. This is much cleaner than our previous approach, and keeps the template easy to read. If the components differed more, the &lt;code&gt;history&lt;/code&gt; logic could easily be broken into multiple functions.&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;Sometimes there is a need to dynamically choose the component to display when looping over a list of items. This is very well supported by VueJS and made easy using the &lt;code&gt;component&lt;/code&gt; tag. As complexity grows and components begin to be re-used throughout an application, these components may have prop interfaces that aren't really compatible with each other. Dynamically binding props to the component, just like dynamically declaring the component to be used, helps keep the template clean and readable.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Quick Tip: Disable Button On Click</title>
      <dc:creator>Jordan Kicklighter</dc:creator>
      <pubDate>Thu, 10 Oct 2019 15:03:01 +0000</pubDate>
      <link>https://dev.to/jwkicklighter/quick-tip-disable-button-on-click-3ek1</link>
      <guid>https://dev.to/jwkicklighter/quick-tip-disable-button-on-click-3ek1</guid>
      <description>&lt;p&gt;In a world full of JS frameworks and templating languages, there's still occasionally a need to write very simple pages. With a habit of leaning into Vue, React, etc. it can be easy to forget the basics when we don't need anything flashy.&lt;/p&gt;

&lt;p&gt;Here's a tiny snippet to disable a button when it's clicked without the need for any extra JS scripts. It only takes a few words in an &lt;code&gt;onclick&lt;/code&gt; attribute. Could be useful if you have some basic HTML form that submits on a button press.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/jwkicklighter/embed/KKKdagv?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>html</category>
    </item>
    <item>
      <title>What do you want to accomplish, unrelated to development?</title>
      <dc:creator>Jordan Kicklighter</dc:creator>
      <pubDate>Fri, 04 Oct 2019 14:37:51 +0000</pubDate>
      <link>https://dev.to/jwkicklighter/what-do-you-want-to-accomplish-unrelated-to-development-4jba</link>
      <guid>https://dev.to/jwkicklighter/what-do-you-want-to-accomplish-unrelated-to-development-4jba</guid>
      <description>&lt;p&gt;I've always found it enjoyable to hear what dreams, hobbies, interests, etc. other devs have. More often than not, there are similar interests that come up where you wouldn't expect. For instance, it always surprises me how many developers talk about their background in music performance when I share stories from high school/college marching band.&lt;/p&gt;

&lt;p&gt;To get the ball rolling, my current life goal is to obtain a private pilot license. There are many reasons, and I'll likely do more research on ways to help the community such as the Civil Air Patrol, but the biggest draw is how much travel freedom that would provide. Imagine being able to fly from Orlando to Atlanta in the same time it takes to drive from Orlando to Tallahassee. (This is a random estimate, but I think my point still stands).&lt;/p&gt;

&lt;p&gt;So what do you want to accomplish in life, outside of what you'd normally share on DEV?&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Two-Factor Authentication</title>
      <dc:creator>Jordan Kicklighter</dc:creator>
      <pubDate>Mon, 26 Aug 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/jwkicklighter/two-factor-authentication-1k7i</link>
      <guid>https://dev.to/jwkicklighter/two-factor-authentication-1k7i</guid>
      <description>&lt;p&gt;&lt;em&gt;Though this isn’t a new topic, I originally posted this on a different blogging platform and later moved it to &lt;a href="https://medium.com/@jwkicklighter/two-factor-authentication-96828afc4fd2" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;. It felt like a good idea to move it here (and to my &lt;a href="https://jwkicklighter.com/posts/two-factor-authentication" rel="noopener noreferrer"&gt;blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This article is geared toward being understandable by less tech-savvy folks. If that describes you, or if you've ever tried to touch on the subject with anyone in that category, this article should provide some good basic info on the topic of Two Factor Authentication.&lt;/p&gt;

&lt;h1&gt;
  
  
  What Is It?
&lt;/h1&gt;

&lt;p&gt;Generally speaking, the online services that we use regularly only require one form of authentication: a password. You tell the website who you are (your username) and then verify that you actually are who you said you are (with your password). Two factor authentication is exactly what it sounds like. Rather than having a single authentication factor, you have a second piece of information to identify yourself. Depending on the use, this may be a physical key that must be present when you type your password, it could be a fingerprint scan, or it could be a specially generated code that changes over a period of time. The most common two factor authentication for online services involves a 6-digit numeric code that gets regenerated every 30 seconds or so. Your phone or other device knows a secret about creating this code, and the online service you're using knows the same secret. When you go to a website to login, you enter your username and password. You are then prompted for the 6-digit code that is valid for that exact moment in time. Google, Facebook and many other popular sites both this method. Other services, such as Twitter, opt to send your phone a text message with a unique code when you try to login, which still requires access to your personal device.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Should I Use It?
&lt;/h1&gt;

&lt;p&gt;If you haven't noticed, data breaches are getting a little too common these days. We're living in an era of technology and in a time when "data" is a buzzword among tech companies and news stories. Tech giants have your data, and everyone else wants to take it. Until the last several years, we have relied on passwords (and weak ones at that) to verify identities. With fast computers, it takes much less effort to crack passwords than it used to. The beauty of two factor authentication is that it doesn't matter who has your password. In order to login to my Gmail account, someone must know my username, password, and have physical access to one of my electronic devices during the exact moment he/she is trying to login.&lt;/p&gt;

&lt;h1&gt;
  
  
  Where Do I Start?
&lt;/h1&gt;

&lt;p&gt;Some services have different solutions to this security problem, but luckily most of them support an open authentication standard. Google has created an app on iOS and Android called Google Authenticator. Getting started is as simple as going into the settings of whatever site you want to enable authentication on (Gmail, Facebook, etc.) and scanning a QR code on your computer with the Google Authenticator app. While this app does a great job of keeping things simple, it's just a little too simple for me. For instance, if I ever lose my device I have to reset all of the authentication codes for every service I use. You're also out of luck if you don't have an iPhone, iPad, or Android device.&lt;/p&gt;

&lt;p&gt;Enter Authy. Google Authenticator did a great job of getting people to stop making excuses and start using better authentication, but that’s about as far as it went. Authy creates an account that stores all of your authorization codes so that you can get them on multiple devices. I know it seems odd to enable two factor authentication to make things more secure than a password, and then turn around and store them in an account that’s only protected by a password. The key here is that you use one lengthy, confusing, hard-to-crack password for this account. The benefit is removing the negatives from using two factor authentication and securing your online accounts. Authy has apps for Android, iOS, Blackberry, and Chrome, and they all stay synchronized with each other (and password protected). It’s also worth mentioning that the apps look infinitely nicer than the bland Google Authenticator apps.&lt;/p&gt;

&lt;p&gt;Some sites, such as Twitter and Facebook*, offer their own solutions as well. But most places that offer two factor support the Google Authenticator/Authy standard. So go download Authy on your main device and read how to enable two factor for your Google account. What are you waiting for? You can't afford not to be secure anymore.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;With Facebook, you can use the Facebook mobile apps to generate codes, as well as using Authy or Google Authenticator.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>internet</category>
      <category>security</category>
    </item>
    <item>
      <title>Bash Quick Tips</title>
      <dc:creator>Jordan Kicklighter</dc:creator>
      <pubDate>Thu, 22 Aug 2019 20:59:54 +0000</pubDate>
      <link>https://dev.to/jwkicklighter/bash-quick-tips-1o1k</link>
      <guid>https://dev.to/jwkicklighter/bash-quick-tips-1o1k</guid>
      <description>&lt;p&gt;&lt;em&gt;This was originally posted to my &lt;a href="https://jwkicklighter.com/posts/bash-quick-tips" rel="noopener noreferrer"&gt;blog&lt;/a&gt; with some photo examples included.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is a collection of bash aliases/functions and git aliases that make my life a little easier and save me keystrokes. Hopefully you find something useful in here, let me know what tips you have!&lt;/p&gt;

&lt;h1&gt;
  
  
  Bash
&lt;/h1&gt;

&lt;p&gt;Aliases and functions for bash (although technically I use zsh). Some are mine, and some were collected from the internet. Credit is provided where relevant.&lt;/p&gt;

&lt;p&gt;For organizational purposes, I have my aliases in &lt;code&gt;.zshrc&lt;/code&gt; and most of the functions in a separate file callked &lt;code&gt;.zsh_functions&lt;/code&gt; that is included near the top of my &lt;code&gt;.zshrc&lt;/code&gt;. Some functions are in separate bash files that are available in my path, and I am in the process of moving most functions into there to lower the amount of functions zsh has to load into memory at start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Current IP
&lt;/h2&gt;

&lt;p&gt;Get your current external IP address.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;ip&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;dig +short myip.opendns.com @resolver1.opendns.com&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage: &lt;code&gt;ip&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Credit: &lt;a href="https://www.linuxtrainingacademy.com/determine-public-ip-address-command-line-curl/" rel="noopener noreferrer"&gt;Linux Training Academy&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Make Directory and Go There
&lt;/h2&gt;

&lt;p&gt;Pretty straightforward, this makes a new directory and does a cd into it, saving a command and saving retyping.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkc &lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$@&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$@&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage: &lt;code&gt;mkc [Directory Name]&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Git
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Git Checkout Search
&lt;/h2&gt;

&lt;p&gt;This function opens an &lt;code&gt;fzf&lt;/code&gt; fuzzy-search prompt for your git branches, allowing you to find the branch you want with fuzzy search. Since the &lt;code&gt;zsh&lt;/code&gt; alias for &lt;code&gt;git checkout&lt;/code&gt; is &lt;code&gt;gco&lt;/code&gt;, adding the &lt;code&gt;s&lt;/code&gt; for "search" made sense to me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: this requires &lt;code&gt;fzf&lt;/code&gt; to be &lt;a href="https://github.com/junegunn/fzf#installation" rel="noopener noreferrer"&gt;installed&lt;/a&gt; and in your path.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcos &lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  git fetch
  &lt;span class="nb"&gt;local &lt;/span&gt;branches branch
  &lt;span class="nv"&gt;branches&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git branch &lt;span class="nt"&gt;-a&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
  &lt;span class="nv"&gt;branch&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$branches&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | fzf +s +m &lt;span class="nt"&gt;-e&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
  git checkout &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$branch&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s2"&gt;"s:.* remotes/origin/::"&lt;/span&gt; | &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s2"&gt;"s:.* ::"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage: Type &lt;code&gt;gcos&lt;/code&gt;, hit enter, and then start typing your branch name&lt;/p&gt;

&lt;p&gt;Credit: Christoffer Skeppstedt's post on &lt;a href="https://coderwall.com/p/ba8afa/git-branch-fuzzy-search-checkout" rel="noopener noreferrer"&gt;Coderwall&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Done with Branch
&lt;/h2&gt;

&lt;p&gt;On projects using Pull Requests/Merge Requests heavily, I found myself constantly clearing out old branches after they were finished. This git alias will checkout &lt;code&gt;master&lt;/code&gt; and delete the branch you were just using, but only if it has been merged &lt;em&gt;somewhere&lt;/em&gt;. So if it's been pushed to a remote branch or merged to another local branch, it will be removed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# in .gitconfig&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="k"&gt;done&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"!f() { git checkout master &amp;amp;&amp;amp; git branch -d @{-1}; }; f"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage: Type &lt;code&gt;git done&lt;/code&gt;, hit enter, and be transported to master while your old branch is annhilated (from your machine only)&lt;/p&gt;

&lt;h2&gt;
  
  
  Push New Branch
&lt;/h2&gt;

&lt;p&gt;On those same projects, there end up being many branches made locally that need to be pushed to a remote. This bash alias pushes your current branch to &lt;code&gt;origin&lt;/code&gt;, creating a branch with the same name as your local branch. (I used &lt;code&gt;gpu&lt;/code&gt; because &lt;code&gt;gp&lt;/code&gt; is the zsh alias for &lt;code&gt;git push&lt;/code&gt;. So I think "git push upload" in my head.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;gpu&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git push -u origin $(git rev-parse --abbrev-ref HEAD)'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage: &lt;code&gt;gpu&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Pretty Git Log Tree
&lt;/h2&gt;

&lt;p&gt;Display the git log in a tree format.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;gl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git log --all --graph --decorate --oneline --simplify-by-decoration'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage: &lt;code&gt;gl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Credit: someone on Twitter several years ago.&lt;/p&gt;

&lt;h1&gt;
  
  
  Kubernetes
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Execute Commands in Pods
&lt;/h2&gt;

&lt;p&gt;For some of my work, I will have a Kubernetes cluster with debug pods for developers to connect to. I was getting annoyed by having to use &lt;code&gt;kubectl get pods&lt;/code&gt; to find the current pod name when I &lt;em&gt;knew&lt;/em&gt; that some part would always be consistent (e.g. maybe the word "debug" is present).&lt;/p&gt;

&lt;p&gt;This function is used like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kube_exec [STRING IN POD NAME] [CONTAINER IN POD] [COMMAND]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So for example, if we have a Kubernetes pod called &lt;code&gt;app-debug-pod-12345&lt;/code&gt; with a container inside called &lt;code&gt;rails&lt;/code&gt;, the command &lt;code&gt;kube_exec debug rails bash&lt;/code&gt; will start a &lt;code&gt;bash&lt;/code&gt; session in the &lt;code&gt;rails&lt;/code&gt; container running in the &lt;strong&gt;first&lt;/strong&gt; pod that is found containing the string &lt;code&gt;debug&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kube_exec &lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nv"&gt;exec_pod&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;kubectl get pods &lt;span class="nt"&gt;--field-selector&lt;/span&gt; &lt;span class="s1"&gt;'status.phase!=Failed'&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;&lt;span class="s2"&gt;" "&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; 1 | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-1&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Executing &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;2&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; in &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;exec_pod&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; at &lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;kubectl config view &lt;span class="nt"&gt;-o&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.current-context}'&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;

  kubectl &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nv"&gt;$exec_pod&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="nv"&gt;$2&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nv"&gt;$3&lt;/span&gt;
  &lt;span class="nb"&gt;unset &lt;/span&gt;exec_pod
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage: &lt;code&gt;kube_exec [POD NAME] [CONTAINER] [COMMAND]&lt;/code&gt;&lt;/p&gt;

</description>
      <category>bash</category>
      <category>git</category>
      <category>kubernetes</category>
      <category>zsh</category>
    </item>
    <item>
      <title>Pass all props to children in Vue</title>
      <dc:creator>Jordan Kicklighter</dc:creator>
      <pubDate>Fri, 16 Aug 2019 17:15:25 +0000</pubDate>
      <link>https://dev.to/jwkicklighter/pass-all-props-to-children-in-vue-9on</link>
      <guid>https://dev.to/jwkicklighter/pass-all-props-to-children-in-vue-9on</guid>
      <description>&lt;p&gt;&lt;em&gt;This article is also posted on my &lt;a href="https://jwkicklighter.com/posts/pass-all-props-to-children-in-vue" rel="noopener noreferrer"&gt;blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;While brainstorming some new Vue components, I wanted to have a way that a single wrapper component could fetch all of the data needed for the children views, and pass that data through (around 5 layers of) children down to the the bottom.&lt;/p&gt;

&lt;p&gt;So I did some experimenting, and here’s a way to pass all component props down through child components. &lt;a href="https://codepen.io/jwkicklighter/pen/zYOBvmr" rel="noopener noreferrer"&gt;Link to codepen&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Vue actually makes this very easy for us. All component props are available in the &lt;code&gt;$props&lt;/code&gt; object (&lt;code&gt;this.$props&lt;/code&gt; if you're not in the template), and we can use the Vue directive &lt;code&gt;v-bind&lt;/code&gt; without specifying a specific prop name in order to bind a whole object of props to the child.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;Let's assume we have some wrapper component that is going to render a child &lt;code&gt;comp1&lt;/code&gt; component and pass it both &lt;code&gt;propForComp1&lt;/code&gt; and &lt;code&gt;propForComp2&lt;/code&gt; as props.&lt;/p&gt;

&lt;p&gt;Here's &lt;code&gt;Comp1.vue&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;class=&lt;/span&gt;&lt;span class="s"&gt;"comp1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{{&lt;/span&gt; &lt;span class="nx"&gt;propForComp1&lt;/span&gt; &lt;span class="si"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;comp2&lt;/span&gt; &lt;span class="na"&gt;v-bind=&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;/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;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&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="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Comp2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;propForComp1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;propForComp2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&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;Notice that &lt;code&gt;comp1&lt;/code&gt; is only using &lt;code&gt;propForComp1&lt;/code&gt; and doesn't really care about &lt;code&gt;propForComp2&lt;/code&gt;. But since it needs to be included in the props passed to &lt;code&gt;comp2&lt;/code&gt;, &lt;code&gt;propForComp2&lt;/code&gt; still needs to be declared inside the &lt;code&gt;props&lt;/code&gt; object. If not, &lt;code&gt;$props&lt;/code&gt; will not contain it.&lt;/p&gt;

&lt;p&gt;You can do this for many levels of components, but remember that the props &lt;strong&gt;any&lt;/strong&gt; child needs must be declared in &lt;strong&gt;all&lt;/strong&gt; parents. So if you have 5 layers, &lt;code&gt;propForComp5&lt;/code&gt; must be declared as a prop in &lt;code&gt;prop1&lt;/code&gt;, &lt;code&gt;prop2&lt;/code&gt;, &lt;code&gt;prop3&lt;/code&gt;, &lt;code&gt;prop4&lt;/code&gt;, and &lt;code&gt;prop5&lt;/code&gt;. You can make this a little easier by using a Mixin, which is the route I took in the &lt;a href="https://codepen.io/jwkicklighter/pen/zYOBvmr" rel="noopener noreferrer"&gt;codepen&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: You actually don't have to do this last bit! Just like Vue gives up &lt;code&gt;$props&lt;/code&gt;, the &lt;code&gt;$attrs&lt;/code&gt; object includes all of the passed attributes that the component &lt;strong&gt;doesn't&lt;/strong&gt; declare as props. This means, that we can simply use &lt;code&gt;v-bind="$attrs"&lt;/code&gt; to pass down the attributes that children would care about, even if the component doesn't specify them itself.&lt;/p&gt;

&lt;p&gt;The previous example would turn into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;class=&lt;/span&gt;&lt;span class="s"&gt;"comp1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{{&lt;/span&gt; &lt;span class="nx"&gt;propForComp1&lt;/span&gt; &lt;span class="si"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;comp2&lt;/span&gt; &lt;span class="na"&gt;v-bind=&lt;/span&gt;&lt;span class="s"&gt;"$props"&lt;/span&gt; &lt;span class="na"&gt;v-bind=&lt;/span&gt;&lt;span class="s"&gt;"$attrs"&lt;/span&gt; &lt;span class="nt"&gt;/&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;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&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="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Comp2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;propForComp1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&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;A diff to see the changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;div class="comp1"&amp;gt;
    &amp;lt;span&amp;gt;{{ propForComp1 }}&amp;lt;/span&amp;gt;
&lt;span class="gd"&gt;-   &amp;lt;comp2 v-bind="$props" /&amp;gt;
&lt;/span&gt;&lt;span class="gi"&gt;+   &amp;lt;comp2 v-bind="$props" v-bind="$attrs" /&amp;gt;
&lt;/span&gt;  &amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;
&lt;span class="err"&gt;
&lt;/span&gt;&amp;lt;script&amp;gt;
  export default {
    components: Comp2,
    props: [
      'propForComp1',
&lt;span class="gd"&gt;-     'propForComp2'
&lt;/span&gt;    ],
  }
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks to &lt;a class="mentioned-user" href="https://dev.to/morficus"&gt;@morficus&lt;/a&gt; for pointing this out!&lt;/p&gt;

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