Vue.js

TypeError: Cannot read property '$http' of undefined

人盡茶涼 提交于 2021-02-10 18:48:42
问题 Trying to use vue-resource but i am etting the error described in the title. The code below is in utils section called network.js : import VueResource from 'vue-resource' const getConfig = () =>{ console.log('its working'); // GET /someUrl this.$http.get('https://fdsdfsdf-685a-45ed-8665-9847e0dbce0d.mock.pstmn.io/getConfig') .then(response => { // get body data this.config = response.body; }, response => { // error callback }); }; //Export login so other classes can use it export{ getConfig }

cors issue with vue and dotnet

痞子三分冷 提交于 2021-02-10 18:48:34
问题 my environments: backend (localhost) written in .net web api 2 enabled package "Microsoft.AspNet.WebApi.Cors" frontend (localhost) with vue-js-2 with webpack-simple vue-resource for http requests I am experiencing some CORS issues which I cannot solve: Launching "simple requests" with GET verb works, but when using POST verb I get CORS error, saying: Access to XMLHttpRequest at 'http://localhost:59837/api/Employees' from origin 'http://localhost:8080' has been blocked by CORS policy: Response

Load pdf from server and embed in Vue app

守給你的承諾、 提交于 2021-02-10 18:38:27
问题 I have an api which returns a pdf file. I'm trying to display this in vue.js and found the vue-pdf component which looks like it should do the job. Here's the project on github I'm able to call the API and get the binary response but I've not been able to convert the binary data into something which the vue-pdf library can display. The documentation for the :src prop is here My vue code is below with a few of the failed attempts commented out. <template> <pdf :src="pdfsrc"></pdf> </template>

Trying to run concurrently (npm ERR! code ELIFECYCLE npm ERR!)

僤鯓⒐⒋嵵緔 提交于 2021-02-10 18:30:31
问题 I am trying to create a Full Stack Node & Vue application that takes data from an API. I am running into an issue where I am trying to run both the client and server concurrently but the code is running into an error. Please bear with me if I am structuring this question wrong as I am still fairly new to coding! This is the following error log: [0] Error occurred when executing command: npm run server [0] Error: spawn cmd.exe ENOENT [0] at Process.ChildProcess._handle.onexit (internal/child

Maximum call stack size exceeded - Vue.js

依然范特西╮ 提交于 2021-02-10 18:21:42
问题 I've got a computed method that allows me to count a total price of my products and discount value and would like to get the value of: total - discount. cartTotal() { var total = 0; var discount = Math.round((0.1 * this.cartTotal) * 100) / 100; this.cart.items.forEach(function(item) { total += item.quantity * item.product.price; }); total -= discount; return total; } Doens't work for me and I get that Maximum call stack size exceeded error. 回答1: You're getting that error because you have two

Breakpoints are triggered incorrectly in Visual Studio Code with Vue.js project

南笙酒味 提交于 2021-02-10 16:55:11
问题 I am trying to setup VS Code + Vue.js to work on some Vue.js project. I already did some steps, but I cannot make breakpoints work correctly. if I start the website with npm run dev And then start debugging in VS Code with Debugger for Chrome and set a breakpoint on a certain line of code in a .vue file, the line is normally marked with the red circle, but the breakpoint is triggered in different app.js file in the code like this: // module exports.push([module.i... // exports /***/ }), what

Object doesn't support property or method 'replace' on Internet Explorer 11

折月煮酒 提交于 2021-02-10 16:41:28
问题 I am trying to make my Vuejs application work on IE11. However, one node module ( vue-directive-tooltip ) throw an error on IE11: Object doesn't support property or methode "replace" The module is supposed to be IE11 compatible. I have tried to require the polyfill I need at the top of the entry point to my application. I have also tried to add the node module to the transpile dependencies. vue.config.js: require("@babel/polyfill"); configureWebpack: { entry: ["@babel/polyfill", path.resolve(

牛年大吉!价值3000多的airpods,ikbc键盘,红宝书等超多礼品等你来拿

≡放荡痞女 提交于 2021-02-10 16:29:38
年终大礼 为感谢公众号读者们长久以来的支持,本次我联合几位前端界自媒体大佬们,一起准备一份年终大礼 🎁 希望在年会上没有中奖的你们,可以在我们这抽到奖! 开奖日期是 2 月 11 日晚上 12 点(大年夜晚上 12 点准时开奖) 这里还要感谢图灵出版社对本次活动的大力支持!!( 书籍介绍在文末 ) “ 其中三等奖包含:红宝书 * 10 + 深入浅出 Node.js/深入浅出 Vue.js 任选其一(共 10 本),遵循先到先选原则~ 抽奖方式 关注下面几位公众号后,回复: 2021 ,扫码即可获取助力二维码( 助力次数越多,中奖概率越大哦~ ) 回复 【 2021 】获取抽奖 加油卡 回复 【 2021 】获取抽奖 加油卡 回复 【 2021 】获取抽奖 加油卡 回复 【 2021 】获取抽奖 加油卡 回复 【 2021 】获取抽奖 加油卡 回复 【 2021 】获取抽奖 加油卡 回复 【 2021 】获取抽奖 加油卡 回复 【 2021 】获取抽奖 加油卡 回复 【 2021 】获取抽奖 加油卡 图灵书籍介绍 《JavaScript 高级程序设计(第 4 版)》 本书是 JavaScript 技术经典名著,自 2006 年第 1 版中文版面世时起,至今培养了几代前端技术人员,累计销量超过 32 万册,被技术人员昵称为 JavaScript“红宝书”。本书第 4

dist folder on basic vue.js

微笑、不失礼 提交于 2021-02-10 16:21:49
问题 I created a basic vue.js with Visual studio 2019. I put it on a git in my private azure server. I have a windows build agent. yml for building, no error. trigger: - master pool: 'Default' - script: | npm install npm run build displayName: 'npm install and build' I tried somes "copy/archive files" commands. One of them - task: CopyFiles@2 displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)/VuejsApp1' inputs: TargetFolder: '$(Build.ArtifactStagingDirectory)/VuejsApp1' Every method

How to improve performance while using dynamic components in vue?

时光怂恿深爱的人放手 提交于 2021-02-10 16:14:41
问题 Context: Currently, I am working on a complex editor application which uses vuex state, vuetify's expansion panel and vue's dynamic component. Each dynamic component uses data which is accepted as props and has its own nested components. Problem: The issue with this approach is as the app deals with the large, nested state, the add operation in the UI slows down and makes the UI unusable. Note: In the example, I have added 1000 objects just to replicate the issue. Unfortunately cannot use