Vue.js

What means 'Parsing error: “parserOptions.project” has been set for @typescript-eslint/parser.' error in IntelliJ IDEs family?

此生再无相见时 提交于 2021-01-20 07:52:18
问题 When I open .vue file, below error appears in my IntelliJ IDEA: Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. The file does not match your project config: XX\XX\CurrentFile.vue. The file must be included in at least one of the projects provided. Of course I will be glad if you teach me the solution, but first what I know what it means and WHY it appears. I suspect that it is a some kind of bug, or inaccurate error message. Experimentally known what:

How to remove the console errors in axios?

元气小坏坏 提交于 2021-01-20 07:28:08
问题 Here's my code: async [types.GET_DATA]({commit, state}, data) { try { const res = await axios.post('/login', { email: data.email, password: data.password, }); console.log(res) } catch(e) { if(e.response) { console.log(e.response) } } } So, I return 400 Bad Request whenever user sends empty fields. What axios does is throws the error along with the error response. What I need to do is remove that console error message and only get the error response. How can I do it? 回答1: It is actually

Is it possible to import css file conditionally in Vue.js?

大城市里の小女人 提交于 2021-01-20 07:21:08
问题 I have my admin-panel and pages for clients in one Vue.js project . Is it possible to use certain css-files only if the current route has "forAdmin" meta? 回答1: By using style-loader with the useable API, you can dynamically apply and remove a stylesheet in your code. First you'll need to update your webpack config rules so that stylesheets with the .useable.css extension will be loaded with the useable API: { test: /\.css$/, exclude: /\.useable.css$/, use: [ 'style-loader', 'css-loader' ] },

Is it possible to import css file conditionally in Vue.js?

吃可爱长大的小学妹 提交于 2021-01-20 07:20:41
问题 I have my admin-panel and pages for clients in one Vue.js project . Is it possible to use certain css-files only if the current route has "forAdmin" meta? 回答1: By using style-loader with the useable API, you can dynamically apply and remove a stylesheet in your code. First you'll need to update your webpack config rules so that stylesheets with the .useable.css extension will be loaded with the useable API: { test: /\.css$/, exclude: /\.useable.css$/, use: [ 'style-loader', 'css-loader' ] },

Vue TodoList 入门 Demo

亡梦爱人 提交于 2021-01-20 07:08:59
// TodoList 实例 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>This is todo List</title> <style type="text/css"> .isFinshed{font-size: 20px; font-weight: 800; color: red;} </style> </head> <body> <div id="app"> <input type="text" v-model="message" @keyup.enter="itemsPush"> <ol> <todo-item v-for="(item, index) in items" :key="index" :content="item.label" :index="index" @delete="todoListDelete" :class="{isFinshed: item.isFinshed}"></todo-item> </ol> </div> </body> <script src="https://cdn.bootcss.com/vue/2.4.2/vue.min.js"></script> <script type="text/javascript"> Vue

盘点2020年前端最火的8个技术

情到浓时终转凉″ 提交于 2021-01-20 05:21:45
2020年的年终岁尾,我们一起解读一下整个2020年的前端技术的8个技术, 并深度分析 2021年大前端领域又有哪些顶级技术趋势,你不容错过。 2020年注定是不平凡的一年,相信因为疫情很多程序员的工作和生活都受到了一定影响,其实现在前端的技术已经到了深水区,工程师主要分为前面架构师和前端图形学工程师,那么2021年整个前端技术又有哪些新的趋势? 01 第一个就是 TypeScript,TypeScript 整个呈现出爆发性的增长,在NPM它的下载量达到了四; 02 第二个就是 React 下载量达到了第一,但是Vue的star增长最多。很多人经常问我到底是深入React 还是深入Vue ,我建议你深入React,别问我为什么,你懂的~ 03 第三个就是 WebAssembly 已经逐渐崭露头角,其实我们浏览器这样的桌面应用化的趋势会越来越明显,在前端去增强web应用,WebAssembly 在整个下一年会有更加强劲的趋势 04 第四个就是no-code、low-code、pro-code在今年随着产业互联网的提出,整个行业进入了to b的转型期,未来的低代码会越来越受到大厂的重视,那么这个时候大家一定要去努力奔大厂。 05 第五个就是我们的Devops到NoOps的转换路径之一。变成目前大家都在尝试Serverless,所以在你的简历里如果没有Serverless,一定要尽量尝试

How to use Vue.prototype or global variable in Vue 3?

╄→尐↘猪︶ㄣ 提交于 2021-01-20 04:47:58
问题 Like the title, I want to add Axios into Vue prototype. So when I want to use it, I can use it like this.$axios instead of importing it every time. CODE: //plugins/axios.ts import axios from 'axios' import router from '../router/index' const errorHandle = (): void => {}; const instance = axios.create({ // baseURL: process.env.NODE_ENV == 'development' ? '' : '' baseURL: 'http://localhost:3000', timeout: 1000 * 12 }); instance.defaults.headers.post['Content-Type'] = 'application/x-www-form

How to use Vue.prototype or global variable in Vue 3?

回眸只為那壹抹淺笑 提交于 2021-01-20 04:47:35
问题 Like the title, I want to add Axios into Vue prototype. So when I want to use it, I can use it like this.$axios instead of importing it every time. CODE: //plugins/axios.ts import axios from 'axios' import router from '../router/index' const errorHandle = (): void => {}; const instance = axios.create({ // baseURL: process.env.NODE_ENV == 'development' ? '' : '' baseURL: 'http://localhost:3000', timeout: 1000 * 12 }); instance.defaults.headers.post['Content-Type'] = 'application/x-www-form

How to use Vue.prototype or global variable in Vue 3?

不问归期 提交于 2021-01-20 04:47:13
问题 Like the title, I want to add Axios into Vue prototype. So when I want to use it, I can use it like this.$axios instead of importing it every time. CODE: //plugins/axios.ts import axios from 'axios' import router from '../router/index' const errorHandle = (): void => {}; const instance = axios.create({ // baseURL: process.env.NODE_ENV == 'development' ? '' : '' baseURL: 'http://localhost:3000', timeout: 1000 * 12 }); instance.defaults.headers.post['Content-Type'] = 'application/x-www-form

2021年前端最火的8个技术趋势

走远了吗. 提交于 2021-01-20 04:41:39
2020年的年终岁尾,我们一起解读一下整个2020年的前端技术的8个技术, 并深度分析 2021年大前端领域又有哪些顶级技术趋势,你不容错过。 2020年注定是不平凡的一年,相信因为疫情很多程序员的工作和生活都受到了一定影响,其实现在前端的技术已经到了深水区,工程师主要分为前面架构师和前端图形学工程师,那么2021年整个前端技术又有哪些新的趋势? 01 第一个就是 TypeScript,TypeScript 整个呈现出爆发性的增长,在NPM它的下载量达到了四; 02 第二个就是 React 下载量达到了第一,但是Vue的star增长最多。很多人经常问我到底是深入React 还是深入Vue ,我建议你深入React,别问我为什么,你懂的~ 03 第三个就是 WebAssembly 已经逐渐崭露头角,其实我们浏览器这样的桌面应用化的趋势会越来越明显,在前端去增强web应用,WebAssembly 在整个下一年会有更加强劲的趋势 04 第四个就是no-code、low-code、pro-code在今年随着产业互联网的提出,整个行业进入了to b的转型期,未来的低代码会越来越受到大厂的重视,那么这个时候大家一定要去努力奔大厂。 05 第五个就是我们的Devops到NoOps的转换路径之一。变成目前大家都在尝试Serverless,所以在你的简历里如果没有Serverless,一定要尽量尝试