bootstrap-vue component renders as comment - vuejs2

In my vue project some bootstrap-vue components renders fine but others render as a HTML comment. In this example they both components show up fine in the Vue Dev tool panel. I have added a "normal" input field just to see if that gets rendered ok.
<template>
<div class="list-group">
<div>Test</div>
<b-form-input v-model="text1"
type="text"
placeholder="Enter your name"></b-form-input>
<b-form-textarea id="textarea1"
v-model="text"
placeholder="Enter something"
:rows="3"
:max-rows="6"></b-form-textarea>
<input type="text"/>
</div>
</template>
<script lang="ts">
import {Component, Vue} from 'vue-property-decorator';
#Component
export default class ProjectList extends Vue {
text = 'text';
text1 = 'text1';
}
</script>
But get rendered as:
I would expect to see both the input fields in the browser but I only see the textarea and the "normal" input field. I see no errors in the log. What could I be missing?

Ok I found a solution:
Instead of importing:
import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'
Vue.use(BootstrapVue);
I import:
import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue/dist/bootstrap-vue.esm';
Vue.use(BootstrapVue);
And now everything works fine. I am not sure why as the former is described in the bootstrap-vue documentation. Maybe its because I am using TypeScript..?

Related

Insert 2 components in nuxt.js page

i'm new of this framework :(
the problem is here because i've tried to put the component in another page and work it.
It sign error the component
this is my index.vue page
If you're using nuxt2.0, you should wrap them in a container but this is not needed in nuxt3.0.
<template>
<main>
<navbar />
<slideshow />
</main>
</template>
If this is nuxt2.0, then you should also import the component and register it but you haven't done it here. The path you've given to the component is not correct also.
<script>
import Slideshow from '~/components/slideshow.vue';
export default {
components: { Slideshow }
}
</script>
You need to wrap the into a div or any other tag (to not have multiple tags at the root of the template) like that
<template>
<div>
<navbar></navbar>
<slideshow></slideshow>
</div>
</template>
And you can also skip the import part because Nuxt is already doing that for you as explained here: https://nuxtjs.org/tutorials/improve-your-developer-experience-with-nuxt-components/

Components are not rendering in quasar project with no error

I created Vue 3, quasar project. everything worked fine till the moment I add new component. everything is rendering except the new component which I built and added it to the project. please help me with this problem if you can.
Here is my code:
index page:
<template>
<q-page class="flex flex-center">
<!-- section one-->
<SectionOne />
</q-page>
</template>
<script>
import { defineComponent } from "vue";
import SectionOne from "components/MainPage/SectionOne.vue";
export default defineComponent({
components: {
SectionOne,
},
name: "IndexPage",
});
</script>
Component:
<template>
<div class="q-pa-md q-gutter-md">
<div class="row justify-between">
<q-parallax src="https://cdn.quasar.dev/img/parallax2.jpg">
<h1 class="text-white">Basic</h1>
</q-parallax>
</div>
</div>
</template>
Not sure about your project structure, but try this (missing "./")
import SectionOne from "./components/MainPage/SectionOne.vue";
You can also import from the root 'src' like this:
import SectionOne from "src/components/MainPage/SectionOne.vue";

Vue 3 - Vuetify 3 : color--text not working

I've tried to install Vuetify with Vue3 for the first time today. Almost everything is working properly: components are being imported correctly, classes like "text-center" are working well too.
But I've noticed that props like "dark", and classes like "color--text" are not and I can't tell why ...
Here is my plugins/vuetify.js file:
import '#mdi/font/css/materialdesignicons.css'
import 'vuetify/lib/styles/main.sass'
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/lib/components'
import * as directives from 'vuetify/lib/directives'
export default createVuetify({
components,
directives,
})
For example:
<h1 class="display-2 font-weight-bold mb-3">
<div class="red--text">Welcome to the Vuetify 3 Alpha</div>
</h1>
The text will not be red, nothing changes.
I have no clue where the problem could come from soo ... This is an S.O.S
Thanks!
According to vuetify classes It should be text-red instead of red--text :
<v-app>
<div class="bg-purple-darken-2 text-center">
<span class="text-red">Lorem ipsum</span>
</div>
</v-app>

Vue Scroll to anchor between components

I'm trying to build my portfolio using Vue and Vue Router. What I'm trying to do is have a link in my navbar and when you click it, it will scroll down to that section. I have all my sections in separate components so I can't figure out how to make the scroll behaver function for everything. I have one Home.vue, and that component is the main component and all other components are included inside Home.vue.
Home.vue
<template>
<div class="home">
<HeaderSection />
<AboutSection />
<SkillsSection />
<TimelineSection />
<PortfolioSection />
<TestimonialsSection />
<ContactSection />
</div>
</template>
<script>
// # is an alias to /src
import HeaderSection from "#/components/HeaderSection.vue";
import AboutSection from "#/components/AboutSection.vue";
import SkillsSection from "#/components/SkillsSection.vue";
import TimelineSection from "#/components/TimelineSection.vue";
import PortfolioSection from "#/components/PortfolioSection.vue";
import TestimonialsSection from "#/components/TestimonialsSection.vue";
import ContactSection from "#/components/ContactSection.vue";
export default {
name: "Home",
components: {
HeaderSection,
AboutSection,
SkillsSection,
TimelineSection,
PortfolioSection,
TestimonialsSection,
ContactSection,
},
};
I just found a solution to this. in my Navbar i have an anchor tag <v-btn depressed plain text color="white"> Portfolio </v-btn> that points to the specific id in that component I want to move to <div id="portfolio"></div>. You can also make is scroll smoothly with document.querySelector(element).scrollIntoView({ behavior: "smooth" });

VueJs - ncaught RangeError: Maximum call stack size exceeded. at VueComponent.onFocusin

I have imported a dialog component in my Document.vue. After that, i tried to take Add dialog.Then this console error occurs. When i remove my , this issue will be resolved. Please help me out.
Added code:
<template>
<div class="components" :key="documentComponentkey">
<!--Document Version History Component-->
<DocumentHistoryComponents></DocumentHistoryComponents>
<DialogViewComponents >
<span class="slotcontent" v-if="progressCircular" slot="slotposition" slot-scope="slotProps">
<ProgressCircularComponents :value="uploadPercentage" :size="100" :width="10" :rotate= "360" ></ProgressCircularComponents>
</span>
</DialogViewComponents>
<HeaderComponents></HeaderComponents>
<div class="components-sub-container">
<!--Generic Form Component-->
<BodyComponents>
</BodyComponents>
</div>
<!--Generic Footer Component-->
<FooterComponents></FooterComponents>
</div>
</template>
<script>
import DocumentHistoryComponents from "./DocumentHistory";
import DialogViewComponents from "./../Dialog/Dialog";
import ProgressCircularComponents from "./../ProgressCircular/ProgressCircular";
import HeaderComponents from "./../Card/Header/Header";
import BodyComponents from "./../Card/Body/Body";
import FooterComponents from "./../Card/Footer/Footer";
/**
* Component's properties and events
*/
export default {
components: {
HeaderComponents,
BodyComponents,
FooterComponents,
DocumentHistoryComponents,
ProgressCircularComponents,
DialogViewComponents
},
Anyone knows why this happens
It's likely loop found within one of your components/routing, which triggers the error.