Layout Flashcards

1
Q

How would you add a component to each page in a Nuxt.js app?

A

Enter the component into an element within the of the default.vue file within the “layouts” directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How is the “head” information given from a “page” component?

A
export default {
  head() {
    return {
      title: 'title',
      meta: [
        {
          hid: 'unique-identifier',
          name: 'meta-name',
          content: 'content-description'
        }
      ]
    };
  }
};
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which directory would you put CSS preprocessor (i.e. SASS or PostCSS) files?

A

Assets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the “Nuxt” element in layouts > default.vue represent?

A

The current page is inserted as that element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you add a component permanently to a default Nuxt.js page?

A

Add the component to the template within layouts > default.vue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How should partial components of a default vue page be organized?

A

Create a directory within layouts: layouts > partials > {components}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Where do you define the global CSS stylesheet?

A

In nuxt.config.js, under the “css” array object, add ‘@/assets/css/main.css’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How is a Google font added to your global stylesheet?

A

In nuxt.config.js, head > link > { rel: ‘stylesheet’, href: ‘(google_font_href_uri)’ }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In Nuxt.js, how do you account for meta data on dynamic pages?

A

Use “this” to refer to the specific element that the dynamic page revolves around (i.e. user specific homepage)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly