Vue.js

Initially hide first group in Vue-Formulate repeatable group

心不动则不痛 提交于 2021-02-11 17:01:28
问题 I'm using Vue-Formulate's Repeatable Groups. For my requirements: A group is optional to add If a button is pressed to add a group, then the fields in the group must be validated The form should not initially show the group; it should show the button to add a group For example, the desired initial appearance is in the following screenshot, which I generated after clicking the "remove" / X button in the linked codesandbox: I've mocked this up at codesandbox here: Vue Formulate Group with

How to render custom data in Bootstrap-Vue Table component?

℡╲_俬逩灬. 提交于 2021-02-11 16:43:39
问题 I am using Bootstrap-Vue and VueJs and need help with some custom data rendering from multiple data objects and displaying the data into a table. Specifically, I am following this part of the Bootstrap-Vue TABLE docs: https://bootstrap-vue.js.org/docs/components/table#formatter-callback but I am unsure how to apply it to my code. Here's my scenario: I have a data API providing 2 different arrays of objects: posts and names Posts: [ { "userId": 1, "id": 1, "title": "sunt aut facere repellat

How to get Data from API to display chart using chartjs in Vuejs

心不动则不痛 提交于 2021-02-11 16:35:41
问题 I am new to Vuejs and i wanna know how to fetch data from my API to display chart. Below is my code, where i have used data as "date and challenge" and have fed data directly to it, but now i want to call my API and feed the data from it to "date and challenge". Code that i have used it to display chart without API: <template> <canvas id="mychart" width="550" height="300"></canvas> </template> <script> export default { name: 'Chart', data: () => ({ date: [ 1600934100.0, 1602009600.0,

Vue.js - I have dynamic buttons and I want that the color changes if I clicked one button

吃可爱长大的小学妹 提交于 2021-02-11 15:45:53
问题 I have created buttons dynamically with v-for and now I want that the button which is clicked changes the colour and the other have all the same colour. <template> <div id="exam-screen" class="exam jumbotron"> <h1>{{ title }}</h1> <div class="row"> <p class="col-md-6" v-bind:key="exam.id" v-for="exam in getExam"> <button class="exam exam-btn btn btn-secondary btn-lg btn-block" v-bind:id=" 'exam-' + exam.id + '-' + exam.season + '-' + exam.year + '-btn' " > <span>{{ exam['season_de'] }} {{

How do I send an image to a PHP API using VueJS?

旧街凉风 提交于 2021-02-11 15:02:31
问题 I am trying to send an object which contains an image using Vue to a PHP API but honestly I don't know how, I have my form <form @submit='sendData'> <div class="input-group"> <label for="name">Name</label> <input type="text" @change="getText" name='text' id='text'> </div> <div class="input-group"> <label for="photo">Photo</label> <input type="file" @change="getImage" name='photo' id='photo'> </div> </form> export default{ data(){ return { myData:{ text:'', photo:'' } } } and the getImage()

Not running at local when “npm run serve” command in vue project

只愿长相守 提交于 2021-02-11 14:52:57
问题 I was trying to make some app with vue and installed npm command. when I run "npm run serve" command, I get the following messages. It seems that I was supposed to run app at "http://localhost:8080/" and was able to access sample pages, not like "x86_64-apple-darwin13.4.0:" stuff. is it possible to solve this with changing config file or something ? App running at: - Local: http://x86_64-apple-darwin13.4.0:8080/ - Network: http://x86_64-apple-darwin13.4.0:8080/ Note that the development build

Rendering a base64 image, currently comes back as blank

∥☆過路亽.° 提交于 2021-02-11 14:52:14
问题 I've pulled an image from Microsoft graphQL and applied the following before storing the string in vuex. Buffer.from(image).toString('base64') Inside my component I'm trying to render the image in the following way <img class="shadow avatar border-white" :src="`data:image/jpg;base64,${this.$store.state.user.profilePhoto}`"/> I've tried adding the charset-utf-8 into the mix and a few variations including different image types including png and jpeg. The CSS class simply rounds the image and

Whats the problem with the socketio connection?

流过昼夜 提交于 2021-02-11 14:45:22
问题 Im having this alot of http petitions ( 6k INSIDE LAGGING ) in 1-3 minutes in the console when i receive or send data to a socketio connection. Im using node+express in the backend and vue on the front Backend: app.js mongoose.connect('mongodb://localhost/app',{useNewUrlParser:true,useFindAndModify:false}) .then(result =>{ const server = app.listen(3000) const io = require('./sockets/socket').init(server) io.on('connection', socket =>{ // console.log('client connected') }) if(result){console

How to extend a variable's map in SCSS?

百般思念 提交于 2021-02-11 14:30:22
问题 I am using a package called Buefy which is a Vue.js wrapper for the Bulma CSS framework library. Buefy puts an attribute/property on its template components called type ( e.g. , type="is-warning" ). As per the Buefy documentation, the term "is-warning" is pre-defined according to the $colors variable set within SCSS: So I followed these instructions from Buefy to be able to customize the the $colors map, but what I would like to do, however, is keep the initial SCSS defined in those

Vue Router not working once production is built

99封情书 提交于 2021-02-11 14:15:53
问题 My Vue project works correctly when I build it using dev. However, once I run npm run build and move the files in dist to my webserver, Vue Router doesn't seem to work anymore. I've tried removing history mode, but this didn't work. Vue Router import Vue from 'vue' import Router from 'vue-router' import Home from './views/Home.vue' import axios from 'axios' Vue.use(Router) const router = new Router({ mode: 'history', base: process.env.BASE_URL, routes: [ { path: '/', name: 'home', component: