Vue.js

How to make chartist update on Vuejs

让人想犯罪 __ 提交于 2021-01-29 10:10:57
问题 First of all a happy new year to everyone. I would like to call update at chartist-js . main.js import Chartist from "chartist"; Vue.prototype.$Chartist = Chartist; Component.vue <chart-card :chart-data="performanceUser.data" :chart-options="performanceUser.options" chart-type="Line" data-background-color="green"> </chart-card> Component.vue -> methods getStatsUser(){ UsersAPI.getUserPerformance(this.users.filters.user.active).then(r => { this.performanceUser.data.labels = r.data.labels; this

HTML forms are a mystery

限于喜欢 提交于 2021-01-29 09:55:55
问题 I am taking a Vue.js course and I just learned about forms and managing them(the code is down below). I don't understand how does the tag work. It's value is determined by the option value and the selected text is the text of that specific option? Also, I am confused when it comes to checkboxes and Vue. Why do the checkboxes need different "value"s when you use v-model on that checkbox? Why would I want to create a checkbox group (inputs with the same value for the name attribute)? I don't

How to dynamically mount vue component with props

有些话、适合烂在心里 提交于 2021-01-29 09:55:24
问题 Scenario / context I have an overview component which contains a table and an add button. The add button opens a modal component. When i fill in some text fields in the modal and click the save button, a callback (given as prop) is called so the parent component (the overview) is updated. The save button also triggers the model toggle function so the model closes. So far works everything like expected but when i want to add a second entry, the modal is "pre-filled" with the data of the

Vue3对于一个前端来讲意味着什么?

匆匆过客 提交于 2021-01-29 09:48:52
// 且读且珍惜 // 正文字数 1828 最近很多微信公众号和技术社区,讨论的最多的无非就是 Vue3 了,大多数都是Composition API和基于Proxy的它的原理分析。但是今天老袁想着跟大家聊聊,Vue3对于一个前端更深层次的意义到底意味着什么?我们从这个几个方面来聊聊吧。 悠悠十年,前端框架催人老 理性追框架 Vue的原理的原理了解一下 珍惜年轻的日子 未来可期 悠悠十年,前端框架催人老 相信很多老前端,可能跟我一样。以前天天要兼容IE6、7、8、9、10、11、12+还有一大堆什么你根本叫不上来名字的浏览器,那时候就盼着啥时候有一天能不再兼容这鬼玩意,嗯。到了今天,我们当初心心念念的时代来了,我们再也不用为了CSS而付出太多的努力。虽然依然存在一些不兼容,但是我们可以使用CSS的工作流可以使用PostCSS,甚至直接使用Houdini去介入到浏览器的重绘和重排。那时候我们使用jQuery对浏览器事件的大兼容,更不用搞什么啥babel-polyfill。有人可能会说jq那玩意多恶心啊,谁用啊。其实这东西看怎么写了,写好了其实没那么恶心。不过在今天,大家美滋滋的写着TS的时候,大部分同学其实也未曾关注过所谓编译之后的东西长什么样,其实也挺🤢 Knockout 的横空出世突然让我们觉得手里的jq代码不香了,大家第一次体会到了MVVM的快乐

Vue JS render error on IE / Microsoft Edge

ぃ、小莉子 提交于 2021-01-29 09:43:52
问题 The page is loading correctly on every browser except IE 11 and Microsoft Edge. The only error that i can see is "SCRIPT1028: SCRIPT1028: Expected identifier, string or number chunk-vendors.8615b873.js (1407,41419)". The code: this.form.addEventListener("submit",async e=>{ try{ this.$emit("loading",!0),e.preventDefault(); const{ ,error:n }=await this.$stripe.createToken({...this.card,amount:1e3}); 回答1: Does the error point to the line using { ...obj } object rest/spread properties? The syntax

Reload component with vue-router

三世轮回 提交于 2021-01-29 09:40:20
问题 I have a project with Vuejs and Vue-Router. When a user pay in (login) system, the server return a file Json with token, username and first name, this file is stored in localstorage for be used in following requests. The first name is used in layout for show a message welcome in the navbar. After logout, localstorage is cleared and the problem is here, when other user pay in the message welcome not reload with new first name. <v-chip>{{bienvenida}}</v-chip> computed: { bienvenida() { const

How to set up Vue routes or override back button to function like an app

僤鯓⒐⒋嵵緔 提交于 2021-01-29 09:40:11
问题 I am building a cordova Vue app. In many cases there is deeper links like this /profile/:id/:contact_type/contacts:contact_id Where you would first be on /profile/:id and then click a link to go to /profile/:id/:contact_type/contacts:contact_id The standard router.go(-1) works fine if you were on the profile page first. But if you get a notification or something, and are sent from any page, for example /settings/:id . Your back button should behave more like an Up button, pressing back on

Why is this lifecycle hook code working twice?

∥☆過路亽.° 提交于 2021-01-29 09:31:36
问题 There is such a code: <template> <div class="wrapper"> </div> </template> <script> import axios from 'axios'; export default{ created () { console.log('222'); this.getTrackerIdData(); this.getTrackerData(); }, methods: { getTrackerIdData () { return axios.get("https://seo-gmbh.eu/couriertracker/json/couriertracker_api.php?action=tracking_new.create" , { }) .then(response => { this.$store.commit('tracker/setTrackingKeyId', response.data.data.tracking_new_key_id); this.$store.commit('tracker

How do I include image in BootstrapVue carousel?

不想你离开。 提交于 2021-01-29 09:30:28
问题 I am trying to add an image to the img-src="" attribute of b-carousel in BoostrapVue. The image is currently saved in the asset folder. <b-carousel-slide img-src="../assets/life.jpg"> <h1>Hello world!</h1> </b-carousel-slide> I have added Find below images of the result: I am certain the images are correctly saved in the right location: 回答1: If using a loader with webpack (i.e. vue-loader, url-loader, etc), you need to ensure that the loader knows that img-src accepts a URL. See the docs on

vue3对于一个前端来说意味着什么

我怕爱的太早我们不能终老 提交于 2021-01-29 09:12:56
强力推荐前端面试刷题神器 精彩文章回顾,点击直达 点分享 点收藏 点点赞 点在看 本文分享自微信公众号 - 前端先锋(jingchengyideng)。 如有侵权,请联系 support@oschina.cn 删除。 本文参与“ OSC源创计划 ”,欢迎正在阅读的你也加入,一起分享。 来源: oschina 链接: https://my.oschina.net/u/4581713/blog/4910203