Vue.js

vue项目首页优化记录

笑着哭i 提交于 2021-01-21 22:23:46
####1.起因   项目打包的时候发现部分文件过大:vender.js有400K,app.css高达1.6M。看着这个数值,瞬间凌乱。 ####2.优化   2.1 优化vender.js     是因项目的依赖 vue、vue-router、vuex、axios 造成的,可使用cdn,注意更换对应版本号 <script src="//cdn.bootcss.com/vue/2.5.2/vue.min.js"></script> <script src="//cdn.bootcss.com/vue-router/3.0.1/vue-router.min.js"></script> <script src="//cdn.bootcss.com/vuex/3.0.1/vuex.min.js"></script>     在 build/webpack.base.conf.js 中添加如下代码,使其不打包进文件 module.exports = { //... externals: { 'vue': 'Vue', 'vue-router': 'VueRouter', 'vuex':'Vuex' }, //... }     去掉相关引用代码 // import Vue from 'vue' // import Router from 'vue-router' // import

npm 安装 @vue/cli 报错问题解决

牧云@^-^@ 提交于 2021-01-21 12:35:58
使用的是 macOS 系统,在终端中使用命令安装。 安装命令 sudo npm install -g @vue/cli 结果报错 gyp WARN EACCES current user ( "nobody" ) does not have permission to access the dev dir "/Users/wanchao/Library/Caches/node-gyp/14.15.3" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/node/lib/node_modules/@vue/cli/node_modules/fsevents/.node-gyp" gyp WARN install got an error, rolling back install gyp WARN install got an error, rolling back install gyp ERR ! configure error gyp ERR ! stack Error: EACCES: permission denied, mkdir '/usr/local/node/lib/node_modules/@vue/cli/node_modules/fsevents/.node

当下最流行的后端框架

╄→尐↘猪︶ㄣ 提交于 2021-01-21 12:35:00
程序员日常开发,很需要一块适合自己适合项目的脚手架(快速开发平台),这也是我们团队准备解决这一痛点,开发了 xiaonuo系列 框架,虽说是开源平台同系列产品较多,从代码规范二次开发方面,我极力推荐使用小诺。 Vue前后分离登录界面 推荐理由: 模块化架构设计,层次清晰,业务层推荐写到单独模块,方便升级。 前后端分离架构,分离开发,分离部署,前后端互不影响。 前端技术采用vue + antdvPro + axios。 后端采用spring boot + mybatis-plus + hutool等,开源可靠。 基于spring security(jwt) + 用户UUID双重认证。 基于AOP实现的接口粒度的鉴权,最细粒度过滤权限资源。 基于hibernate validator实现的校验框架,支持自定义校验注解。 提供Request-No的响应header快速定位线上异常问题。 在线用户可查,可在线踢人,同账号登录可同时在线,可单独在线(通过系统参数配置)。 支持前端 + 后端在线代码生成。 文件,短信,缓存,邮件等,利用接口封装,方便拓展。 文件默认使用本地文件,短信默认使用阿里云sms,缓存默认使用内存缓存。 用户管理 代码风格统统采用阿里巴巴规范进行开发,分包合理,升级方便 来源: oschina 链接: https://my.oschina.net/u/4355040

Vuetify Offline Docs

邮差的信 提交于 2021-01-21 12:24:16
问题 I have started using Vuetify to add ui-components and use pre-defined layouts. The problem is that I have to look into online-docs every now and then, and requires me to be connected to internet perpetually. Is there a way to get offline docs for Vuetify? Like an html built with doxygen/javadocs, or a CHM? PDF? LaTEX? Anything really helps. 回答1: Update git clone https://github.com/vuetifyjs/vuetifyjs.com.git has become a private project. The docs are now in the packages/docs/ directory.

Vue and API: Displaying Image

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-21 11:44:32
问题 I am currently using Vue JS and the data is coming from API . to call a data from API I use this method {{services.service_picture}}. But the problem is I am unable to display the image with this method below. Can you please send some ideas on how to display it using Vue JS <div id="main" v-cloak> <div class="col-sm-5"> <p v-for="picture in services.service_picture"></p> <img :src="path + '/images/services/'+ picture" class="img-circle" alt="Services" /> </div> </div> var main = new Vue({ el:

Vue and API: Displaying Image

你。 提交于 2021-01-21 11:43:09
问题 I am currently using Vue JS and the data is coming from API . to call a data from API I use this method {{services.service_picture}}. But the problem is I am unable to display the image with this method below. Can you please send some ideas on how to display it using Vue JS <div id="main" v-cloak> <div class="col-sm-5"> <p v-for="picture in services.service_picture"></p> <img :src="path + '/images/services/'+ picture" class="img-circle" alt="Services" /> </div> </div> var main = new Vue({ el:

Why does `this` inside filter() gets undefined in VueJS?

风格不统一 提交于 2021-01-21 07:59:07
问题 I am creating a DOB Form. I am using VueJS in the form. The user should their date of month first so that day is displayed according to the number of days in the respective month. I am using filter() and the problem is this inside filter() is undefined. How can I fix this? new Vue ({ el: '.app', data: { months: [ {month: 'January', days: 31}, {month: 'February', days: 28}, {month: 'March', days: 31}, {month: 'April', days: 30}, {month: 'May', days: 31}, {month: 'June', days: 30}, {month:

Why does `this` inside filter() gets undefined in VueJS?

无人久伴 提交于 2021-01-21 07:58:20
问题 I am creating a DOB Form. I am using VueJS in the form. The user should their date of month first so that day is displayed according to the number of days in the respective month. I am using filter() and the problem is this inside filter() is undefined. How can I fix this? new Vue ({ el: '.app', data: { months: [ {month: 'January', days: 31}, {month: 'February', days: 28}, {month: 'March', days: 31}, {month: 'April', days: 30}, {month: 'May', days: 31}, {month: 'June', days: 30}, {month:

Is it possible to have html-webpack-plugin generate <style> elements from css?

▼魔方 西西 提交于 2021-01-21 07:32:11
问题 I have a static site where I am using Vue and Webpack. I have some global CSS rules in a file called style.css and I am importing them by using import './styles.css' from my index.js file. Additionally, I have some .vue files which generate their own CSS. To generate the HTML page, I am using html-webpack-plugin . My CSS rules appear to be applying correctly. However, the <style> tags which contain them are dynamically being added to the <head> of my page via the Javascript that Webpack