Vue
jamey8383
这个作者很懒,什么都没留下…
展开
-
[原创] Vuex 入坑记 (一)
1) ...mapActions(['updateHeroAction', 'deleteHeroAction', 'addHeroAction']), 一定要放在 methods 下。错误的放在 computed 下找了半天才发现问题。2) ...mapGetters(['getterOfHeroes']), getters 放在 computed 下, 此条语句类似于如下语句,添加了一...原创 2019-11-23 00:19:33 · 74 阅读 · 0 评论 -
(Forward) ['String'] to be function name, Javascript-Computed Property Names (ES6)
Unlike python dictionary, javascript objects need not have quotes around properties.var eatables = {fruit: 'Apple', vegetable: 'Carrot'}var edibles = {'fruit': 'Apple', 'vegetable': 'Carrot'}// b...转载 2019-11-20 16:12:38 · 82 阅读 · 0 评论 -
(原创) vue-element-admin 中使用 vuex 对 token 进行管理的解析
Vuex store 的状态管理如下图。//普通定义的index.jsimport Vue from 'vue';import Vuex from 'vuex';import { dataService } from '../shared';import { GET_HEROES } from './mutation-types'Vue.use(Vuex);c...原创 2019-11-20 15:55:41 · 5500 阅读 · 0 评论 -
(原创) Vue Router 中 3 种 route 的方式
1. router api<button class="link card-footer-item" @click="showDetail({name: 'hero-detail', params:{id: hero.id} })"><span>Select</span></button>showDetail(heroDetail){ ...原创 2019-11-18 11:47:32 · 350 阅读 · 0 评论 -
(原创) Vue 中 Route 传参和 props 的解析
先说正确的方法如下,箭头函数返回对象字面量,记住用params => {object:literal}这种简单的语法返回对象字面量是行不通的。https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/Arrow_functionshttps://cloud.tencent.com/dev...原创 2019-11-17 22:40:11 · 1435 阅读 · 0 评论 -
(转载)vue中axios设置公共请求地址
先描述一下场景:vue项目,后台请求地址在配置文件中已经设置为全局的,每次变动只需修改一次即可,然后要部署到三台服务器。然后:修改服务器地址,打包,部署 -->修改服务器地址,打包,部署 -->修改服务器地址,打包,部署 (3次 " for循环 ")那么当我们需要部署多台服务器的时候,怎么避免减少重复性的工作呢?下面介绍一种方法来减少任务量:1、新建配置文件(con...转载 2019-11-13 21:47:20 · 1182 阅读 · 0 评论 -
(原创)子组件 props 属性等价子组件的 data model
子组件 HeroDetail 有props 属性, 并在父组件 Heroes 中被使用export default { name: 'HeroDetail', props: { hero: { type: Object, default: () => { }, }, }, }...原创 2019-11-12 23:53:58 · 153 阅读 · 0 评论 -
(转载)vue-admin-template笔记(一)
文章目录Vue学习笔记(一)初步印象子模块main.jsApp.vuerouter总结参考Vue学习笔记(一)学习vue-admin-templatehttps://github.com/PanJiaChen/vue-admin-template初步印象src目录如下.├── App.vue├── api├── assets├── components├──...转载 2019-11-12 14:51:53 · 195 阅读 · 0 评论 -
(转载)axiosDELETE和PUT传参方式
网上的回答都是以下这种:axios.delete({ url: 'http://localhost:3000/todos', data: { "id": "a" } }) .then(function (response) { ...转载 2019-11-12 13:52:46 · 731 阅读 · 0 评论 -
(转载)Vue中出现avoid using JavaScript unary operator as property name: "delete(item.id)" 错误的原因
因为使用了js关键字delete,把方法名delete换一下即可。转载 2019-11-12 12:01:45 · 872 阅读 · 0 评论 -
(转载)Vue项目怎么接入OAuth2.0
前言最近公司让我做一下客户端如何接入OAuth2.0服务器认证的实例给客户,本身对这块不是很熟悉,上网找了很多资料,这里把我的成果记录一下。这篇文章主要还是讲项目实现,概念的学习感觉还学的不到家,准备整理整理再写。项目实现主要还是参考了阮一峰老师的《理解OAuth 2.0》吧,大家可以学习这一篇文章,对于OAuth2讲的很详细。过程实现下面是接入的过程,实现的授权模式是最常用的授权...转载 2019-11-12 11:56:28 · 1849 阅读 · 0 评论 -
(FW) typing a backtick on Mac OS X Snow Leopard
Disclaimer: This info is for English keyboards. If you're using a keyboard for a different language, look for the keys on your keyboard that match the photos. Pictures of Apple's keyboards for various...转载 2019-11-12 11:45:41 · 145 阅读 · 0 评论 -
mac上设置新版chrome浏览器跨域open -n /Applications/Google\ Chrome.app/ --args --disable-web-security --user-d
最近用php写好了后端接口,但是在用vue写前端的时候,调用本地印射环境的接口的时候就报错打开一个新的可跨域的chrome窗口实现方法:1. 打开终端2. 输入下面的命令( 需要替换路径中的yourname)open -n /Applications/Google\ Chrome.app/ --args --disable-web-security --user-data-di...转载 2019-11-12 11:41:40 · 790 阅读 · 0 评论 -
(原创)Vue 的 computed 模型是组件的模型,不是模型的属性
父组件 Heroes 定义如下,有 computed modelexport default { name: 'Heroes', data() { return { heroes: [], selectedHero: undefined, }; }, components: { HeroDetail, }, computed: { fullName()...原创 2019-11-12 00:12:19 · 120 阅读 · 0 评论 -
(转载) vue获取地址栏传过来的参数VS原生js获取地址栏的参数
方法一:采用正则表达式获取地址栏参数:(强烈推荐,既实用又方便!) 1 2 3 4 5 6 7 8 9 10 11 functionGetQueryString(name) { varreg =newRegExp("(^|&)"+ name +...转载 2019-11-08 15:15:03 · 466 阅读 · 0 评论 -
(原创)Vue 使用 Axios 跨域问题
项目使用 Axios 和 Mock, 今天前后端联调, 碰到若干问题。一、参考文章设置跨域Chrome"mac上设置新版chrome浏览器跨域open -n /Applications/Google\ Chrome.app/ --args --disable-web-security --user-d"https://blog.csdn.net/xiaobo0134/article/d...原创 2019-11-06 23:05:15 · 102 阅读 · 0 评论 -
(转载)axios+mockjs在vue中的使用
原文链接:https://juejin.im/post/5b17ffcc51882513eb62e985一.安装和使用mockjs(参考教程https://blog.csdn.net/HZKang/article/details/78104739)注意这个教程的第四步的代码最后缺少一个结束的 } 号,而且安装他的第四步跑不起项目,我作了改写才行,我的代码是能运行起来的1.npm安装...转载 2019-11-05 15:22:49 · 293 阅读 · 0 评论 -
(转载)Vue 的几种 Directive
1.content text 为变量{{message}}<pclass="card-header-title">{{hero.firstName}}</p>2. property 为变量<div:style="{'background-color':hero.capeColor}"></div><aclass...原创 2019-11-04 22:37:23 · 109 阅读 · 0 评论 -
(转载)用 VUE.JS 做一套 增删改查 CRUD
https://how2j.cn/k/vuejs/vuejs-crud/1787.html#nowhere工具版本兼容问题步骤1:CRUD 步骤2:效果 步骤3:分解动作 步骤4:查询 步骤5:增加 步骤6:删除 步骤7:编辑和更新 步骤1:CRUD顶折CRUD 这个东西还是绕不过去...转载 2019-11-04 20:10:09 · 966 阅读 · 0 评论