DEV Community

Cover image for Interview Questions for Vue

Interview Questions for Vue

Adnan Babakan (he/him) on November 07, 2020

Hey there Dev.to community! I've been a Vue fan for a long time, even before time itself. Here are some questions I've had the experience of being...
Collapse
 
rehmatfalcon profile image
Kushal Niroula

It's worth noting that Filters have been removed in Vue 3.

It is advised to use a regular method call or computed property to achieve its task.

Your example would then become,

{
...,
computed: {
    capitalizedValue: function() {
      if (!this.value) return '';
      return this.value.charAt(0).toUpperCase() + this.value.slice(1);
    }
  },
methods: {
    capitalize: function(value) {
      if (!value) return '';
      value = value.toString()
      return value.charAt(0).toUpperCase() + value.slice(1)
    }
}
...
Enter fullscreen mode Exit fullscreen mode
<div>
{{ capitalizedValue }}

{{ capitalize(value) }}
</div>
Enter fullscreen mode Exit fullscreen mode

Read more about it and the migration strategy here v3.vuejs.org/guide/migration/filte...

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Thanks for reading my article. Yes, I am aware of this change but Vue 3 isn't officially out yet and the current official version is 2. So I omitted Vue 3 related things.

Collapse
 
crisarji profile image
crisarji

Nice article!, 2 things:

  1. VDOM: the shallow answer is ok, but for an interview, explaining the cycle and the difference with the DOM gives extra points!.
  2. What are computer properties in Vue? => mistype, "computed", I guess?.
Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Hi, thanks for reading my article. You are right about number one and thanks for spotting the typo!

Collapse
 
nathandj91 profile image
Nathan DJ

Great article.

Is it worth adding a few Vue 3 questions?

E.g. What is the composition API?

Or even adding something regarding the drawbacks and benefits of render functions vs SFC

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Hi, thanks for reading my article. I also thought of adding this question but since Vue 3 is still not the officially released version I think this question wouldn't fit in an interview.

Collapse
 
nathandj91 profile image
Nathan DJ

Vue 3 was officially released as of 18th September 2020.

There are still a couple of issues, mainly with DevTools and IE support.

If you've updated the CLI and created a new project, it now defaults to Vue 3.

Thread Thread
 
adnanbabakan profile image
Adnan Babakan (he/him)

Yes Vue 3 is released. But the main website still documents Vue 2 by default. So the major version in use is still Vue 2.

Collapse
 
ngthuongdoan profile image
Doan Ngoc Thuong

Great! I want to suggest one more question. Compare Vue with other frameworks and libraries? vuejs.org/v2/guide/comparison.html

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Thanks for reading my article. I don't think comparing two frameworks in performance or other ways would be a good question in an interview. At least I've never encountered one XD.

Collapse
 
ngthuongdoan profile image
Doan Ngoc Thuong

Hmm maybe the better question is "Why Vue? Why did you choose it?"