vue-component

Components of Vuestrap not working with Vue2

*爱你&永不变心* 提交于 2019-12-12 04:36:31
问题 In a single file component in the project created by vue-cli, i want to import some components of vuestrap: import Vue from 'vue' import alert from 'vue-strap/src/alert' import dropdown from 'vue-strap/src/Dropdown' export default { name: 'todo', components: { alert, dropdown }, data() { return { msg: '...' } } } If I only import alert, it is working without any problem. However, if I import Input , Dropdown , i get errors inside the vue files of the vuestrap files itself: ERROR in ./~/vue

Vue2 using $set does not fix change detection caveat when using push() on object

人走茶凉 提交于 2019-12-12 04:18:23
问题 Following on from this issue: Strange issue with Vue2 child component object v-for list render I have a function which loops through an array products , which takes certain values and adds them to an object called attributes . I need to use this.$set to update my attributes object to make sure that Vue can detect the update. My functions look like this: //// checks if the value exists in the object to avoid adding duplicates doesItExist: function(key, value) { for (let i = 0; i < this

Vue v-model with css styling?

扶醉桌前 提交于 2019-12-12 04:09:12
问题 It is hard to explain this problem, so i think i will start by showing what i have: Vue.component('list-component', { data: function() { return { newTask: "", taskList: [], newSubTask: "", subTaskList: [], }; }, template: '<div>' + '<section class="prefetch">' + '<input v-if="showInput" class="input typeahead" type="text" placeholder="mainInput" v-model="newTask" v-on:keyup.enter="addTask">' + '</section>' + '<details v-for="task in taskList" v-bind:key="task.text" class="sub-list-item">' + '

passing a dynamic v-model as function param

两盒软妹~` 提交于 2019-12-12 03:53:34
问题 I am very new to vuejs, and I am working with making a dynamic table where the left column will have a hidden input that will ultimately query a database and display the result in a pop up (for a quick cross referencing ability). I have made it to the point where it builds the table properly with a v-for, but I can't quite figure out how to bind the dynamic v-models to the js function that will run the process. If I am going about this the completely wrong way, please let me know. Cheers and

Update a child's data component to the father component in vue.js using .vue webpack(vue2)

被刻印的时光 ゝ 提交于 2019-12-12 02:31:08
问题 I am testing the components of vue.js and I encountered the problem of updating a parent component when the child changes. I have generated the project with vue-cli (webpack), and I am using components that have their own .vue file. The code: App.vue <template> <div id="app"> <h2>{{ title }}</h2> <div class="pie"> <change-title :title="title"></change-title> </div> </div> </template> <script> import ChangeTitle from './components/ChangeTitle' export default { components: { ChangeTitle }, data

Vue.js does not render correctly using template

懵懂的女人 提交于 2019-12-12 01:43:54
问题 I am working with Vue.js and Django. My goal is to display a list of bins, which I get over a REST API. Here's my JavaScript-Code: Vue.component('bin-detail', { template: '#bin-detail', props: ['bin'] }); var app = new Vue({ el: '#table', data: { message: "Hallo", bins: [] }, mounted: function() { $.get('/api/bins/', function (data) { app.bins = data.results; }) }, delimiters: ['<%', '%>'] }); And my HTML: <div id="table"> <h1><% message %></h1> <table class="table table-hover"> <thead> <tr>

How to solve error “Uncaught (in promise) TypeError: Cannot create property” ? (vue.js 2)

夙愿已清 提交于 2019-12-12 01:43:29
问题 My code is like this : <!DOCTYPE html> <html> <head> <title>Laravel</title> <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css"> </head> <body> <div class="container"> <div class="col-md-8 col-md-offset-2"> <div id="app"> <ul class="list-group"> <li class="list-group-item" v-for="item in items"> <a href="/item/@{{ item.id }}"> @{{ item.title }} </a> </li> </ul> <nav> <ul class="pagination"> <li v-if="pagination.current_page > 1"> <a href="#" aria-label=

Vue.js : How to make dynamic menu?

雨燕双飞 提交于 2019-12-12 01:37:55
问题 Could someone help me with creating menus dynamically from a database? Lets say all the data from the database is already supplied by me, but I want to show a dynamic menu if a user is logged in or not. I created some Vue components App.vue <template> <div id="app"> <navbar></navbar> <div class="page-container"> <leftmenu></leftmenu> <container></container> </div> </div> </template> <script> import Menu from './components/Menu.vue' import LeftMenu from './components/Leftmenu.vue' import

load components dynamically based on choice in the current step in Vue-Form-Wizard

南笙酒味 提交于 2019-12-11 23:53:35
问题 I'm trying to load components dynamically based on choice in the current step. For example, the user has 3 choices in the first step and if he chooses choice one, component One will be loaded in 2end step and so on. The question is here is it possible to do something like this? if it is how to do it? 回答1: You just need to check the value of the radio button once you click the choices using v-model in the next step. It uses v-if so the components that are not selected will not render. Check

Getting Error in mounted hook: “RangeError: Maximum call stack size exceeded” in VUE js

橙三吉。 提交于 2019-12-11 19:08:48
问题 I am new to VUEJS and have little knowledge of state and mutations. I have a state which has a property called OSDViewer. This property of state is not being used anywhere else in app. My state looks like following. const state = { OSDviewer: null, } In my mutations i am trying to set this OSDViwer to an openseadragon object in following way. setupOsdCanvas: (state, payload) => { var OSDviewer = new openseadragon.Viewer({ id: payload, showNavigationControl: false, showNavigator: true,