vue-component

Vue.js - load component from ajax call

試著忘記壹切 提交于 2020-01-24 13:02:27
问题 I'm trying to render or load components from api data. To explain more, let's say I've test-component, which I inject it directly in my parent component, works. But when I'm trying to save the component tag in database and run a ajax call, my component tag shows but doesn't work or rather load / render. Please help. Return from my api: { "_id": "59411b05015ec22b5bcf814b", "createdAt": "2017-06-14T11:16:21.662Z", "updatedAt": "2017-06-14T12:41:28.069Z", "name": "Home", "content": "<test-comp><

How can I set column in row on the card group bootstrap vue?

佐手、 提交于 2020-01-24 12:13:13
问题 My vue component like this : <template> ... <b-card-group deck deck v-for="row in formattedClubs"> <b-card v-for="club in row" :title="club.description" img-src="http://placehold.it/130?text=No-image" img-alt="Img" img-top> <p class="card-text"> {{club.price}} </p> <p class="card-text"> {{club.country}} </p> <div slot="footer"> <b-btn variant="primary" block>Add</b-btn> </div> </b-card> </b-card-group> ... </template> <script> export default { data: function () { return { clubs: [ {id:1,

explain vue-router component as a function

眉间皱痕 提交于 2020-01-24 08:40:07
问题 I have seen in several different places the following type of route definition: { path : '/dashboard', component: { render (c) { return c('router-view') }}, children:[{ path:"", component: Dashboard }] }, I am trying to understand how this is different then { path : '/dashboard', component: Dashboard }, I think it is related to the optional addition of child routs (e.g. /dashboard/user) so that and the children array here just explains that the Dashboard component renders the path /dashboard

vuejs slick is not working with v-for

試著忘記壹切 提交于 2020-01-24 05:39:55
问题 vue-slick is working fine with static content. But when I am trying to loop through playlists of user.slick is not working. html part: <template> <slick ref="slickone" :options="slickOptions"> <div v-for='playlist in user_playlists'> <a href="#"> <img :src="playlist.image"> <p>Playlist Name</p> </a> </div> </slick> </template> script part: <script> import Slick from 'vue-slick'; import './node_modules/slick-carousel/slick/slick.css'; import './node_modules/slick-carousel/slick/slick-theme.css

Register a component to an existing Vue.js instance

旧巷老猫 提交于 2020-01-24 05:31:05
问题 I'm new to Vue.js. I want to register a local component as described over here: https://vuejs.org/v2/guide/components.html#Local-Registration The only issue is that I need to register a component to an existing Vue instance not while creating a new instance something like: const app = new Vue({ el: '#app' }); app.component({ 'my-component': { template: '<div>A custom component!</div>' } }); I have tried Vue.extend for that, but it is not working. Edit: Why I need this: I'm creating a 3rd

Child route component not rendering in vue js [duplicate]

 ̄綄美尐妖づ 提交于 2020-01-24 03:03:48
问题 This question already has an answer here : Activate router-link that has multi level nested routes with CRUD setup (1 answer) Closed 2 years ago . i have defined route like { path:'/admins', name:'admin.admins', component: Admin, children: [ { path:'add', name:'admin.add', component:addAdmin }, { path:'edit/:id', name:'admin.edit', component:editAdmin } ] } if i declare children route outside children like { path:'/admins', name:'admin.admins', component: Admin }, { path:'/add', name:'admin

Child route component not rendering in vue js [duplicate]

别说谁变了你拦得住时间么 提交于 2020-01-24 03:03:40
问题 This question already has an answer here : Activate router-link that has multi level nested routes with CRUD setup (1 answer) Closed 2 years ago . i have defined route like { path:'/admins', name:'admin.admins', component: Admin, children: [ { path:'add', name:'admin.add', component:addAdmin }, { path:'edit/:id', name:'admin.edit', component:editAdmin } ] } if i declare children route outside children like { path:'/admins', name:'admin.admins', component: Admin }, { path:'/add', name:'admin

Change Meta Title and Description using Vue.js

不打扰是莪最后的温柔 提交于 2020-01-23 17:37:46
问题 Is it possible to change anything higher than the body tag in Vue.Js? The contents for both these elements is currently stored in the JSON file that is attached to an element further down the DOM tree. I need to try and inject a meta title and description that can be crawled by Google (ie. It injects, then renders before it gets crawled) and understand the issues with accessing the body element and higher up the DOM tree, as the current Vue JSON is injected using the App ID on a DIV lower

Get all Input values - Vuejs

一笑奈何 提交于 2020-01-23 17:08:09
问题 I have multiple input elements in a simple VueJs application. But I don't have and form elements. Now I want to get all the input values at once and send to server-side [laravel] for processing? <div> <input v-model="foo-bar" placeholder="edit me"> <input v-model="bar-foo" placeholder="edit me"> <input v-model="foo-foo" placeholder="edit me"> <input v-model="bar-bar" placeholder="edit me"> </div> <div> <input type="button" @click="getAllData">Send</input> </div> getAllData(){ // I have no

VueJS: @click.native.stop = “” possible?

China☆狼群 提交于 2020-01-23 13:10:51
问题 I have several nested components on the page with parents component having @click.native implementation. Therefore when I click on the area occupied by a child component (living inside parent), both click actions executed (parent and all nested children) for example <products> <product-details> <slide-show> <media-manager> <modal-dialog> <product-details> <slide-show> <media-manager> <modal-dialog> </products> So I have a list of multiple products, and when I click on "canvas" belonging to