I
I
Igor Myasnikov2019-10-25 09:32:52
JavaScript
Igor Myasnikov, 2019-10-25 09:32:52

Why don't slots work in Nuxt.js?

Good afternoon!!!
There is an Articles component

article.vue

<template lang="pug">
  article.article
    .article__wrapper
      .container
        slot(name="title")
      <ToTop/>
      .article__inner
        slot(name="toc")
        slot(name="text")
        slot(name="files")
        slot(name="doctors")
</template>

<script>
import ToTop from '@/components/to-top.vue';

export default {
  components: {
    ToTop,
  },
};
</script>


And the page where the component is used
page.vue

main.main
  Article
    template(v:slot:title)
      h1.article__title История Центральной районной больницы ст. Романовская
    template(v:slot:text)
      .article__text
        .container
          .article__strong
                h2 Subtitle
...
<script>
import Article from '@/components/sections/article';

export default {
  components: {
    Article,
  },
};


Why don't slots work? There are no errors, but the text is not transmitted either.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danila, 2019-10-25
@pilium

there is no such syntax v:slot:title, there is v-slot:titleor abbreviated #title
read the documentation carefully

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question