-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue warning: Slot "default" invoked outside of the render function #197
Comments
Same here. I tried to update MDC, but I can't because of #191 <template>
<article
v-if="Array.isArray(campaign?.goal_list) && campaign.goal_list.length"
class="tab-list__item goals-page"
role="tabpanel"
>
<section
v-for="(goal, i) in campaign.goal_list"
:key="i"
role="region"
class="tab-list text-body__tab-list goals-page__goal-item"
>
<h2 class="goals-page__goal-amount">
{{ $n(goal.amount / 100, 'currency', { maximumFractionDigits: 0 }) }}
</h2>
<h3 class="goals-page__goal-title">
{{ goal.title }}
</h3>
<MDC :value="goal.description" tag="div" class="goals-page__goal-description" />
</section>
</article>
</template> |
I don't understand why, but it can be fixed by adding a conditional. <MDC v-if="goal.description" :value="goal.description" tag="div" class="goals-page__goal-description" /> |
I have the same issue |
I think it's related with passingan empty string to "value". |
For me, this happens in client mode, when switching between pages, there is a delay along with a warning, and then output. I use a simple |
Have the same issue. Any updates? |
This work for me
|
When I’ve seen this previously, it’s when empty data is passed to the MDC component. Adding a v-if on or surrounding the component to ensure your content (likely reactive) is available before rendering the component should resolve the error. |
Could you provide a simple reproduction? |
I have a weird issue on a page with many nested contents. I've narrowed it down to the
<MDC>
component. I'm not using slots so I'm a bit confused about the warning. Can someone help me understand it?I had the problem in
0.6.1
and it persists in0.7.0
Error
via direct page load - ✅ no errors
If I just load this single page, i.e. refresh page or directly type URL in browser, it works fine.
via Vue Router, navigation -⚠️ shows errors
If I arrive on this page from another page, it loads and renders fine. But there's Vue warnings below that my pedantic self wants to get rid of.
p.s. I tried remove
<sup>
in my markdown. But the problem persisted so it's something with<MDC>
Template
If I remove
<MDC>
and just use{{ item }}
, the warning goes away.What confuses me in the warning is this part
I'm not using
<slot>
anywhere. In the page I am using<ContentDoc v-slot="{ doc }">
. Is that part of the issue?Any ideas?
The text was updated successfully, but these errors were encountered: