摘要: Vux复习一(基础) Vue复习二(渲染函数) Vue复习三(路由) Vue复习四(vue-api) Vue复习五(vuex) Vue复习六(vue-cli/axios) 阅读全文
posted @ 2021-02-11 20:33 猫神甜辣酱 阅读(244) 评论(2) 推荐(3) 编辑
摘要: 基础 axios.get('/user?ID=12345') .then(function (response) { // 成功 console.log(response); }) .catch(function (error) { // 失败 console.log(error); }) .the 阅读全文
posted @ 2021-02-11 20:24 猫神甜辣酱 阅读(76) 评论(0) 推荐(0) 编辑
摘要: vuex 状态管理模块 import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export const store = new Vuex.Store({ state: { count: 0, num:2 }, mutations: { 阅读全文
posted @ 2021-02-11 20:22 猫神甜辣酱 阅读(130) 评论(0) 推荐(0) 编辑
摘要: keyCodes 添加全局自定义键位别名(给v-on添加) Vue.config.keyCodes = { v: 86, f1: 112, // camelCase 不可用 mediaPlayPause: 179, // 取而代之的是 kebab-case 且用双引号括起来 "media-play- 阅读全文
posted @ 2021-02-11 20:21 猫神甜辣酱 阅读(186) 评论(0) 推荐(0) 编辑
摘要: https://router.vuejs.org/zh/installation.html <router-link to="/foo">Go to Foo</router-link> <router-view></router-view> 动态ID /one/:id this.$route.par 阅读全文
posted @ 2021-02-11 20:19 猫神甜辣酱 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 渲染函数 render createElement(" 定义的元素 ",{ 元素的性质 }," 元素的内容"/[元素的内容]) // @returns {VNode} createElement( // {String | Object | Function} // 一个 HTML 标签名、组件选项 阅读全文
posted @ 2021-02-11 20:16 猫神甜辣酱 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 计算属性 computed: { getName: { // 查询 get(){ return this.firstName+this.lastName }, // 就是 this.getName='xxx' 会触发这个方法 set(newval) { this.firstName=newval; 阅读全文
posted @ 2021-02-11 20:08 猫神甜辣酱 阅读(282) 评论(0) 推荐(0) 编辑