摘要: class basicClass { constructor(id, rejion, name) { this.id = id; this.rejion = rejion; this.name = name; } config() { return this; } buy() { let urlBa 阅读全文
posted @ 2020-11-04 16:51 陶智斌 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 导入 import { runInAction, observable, isArrayLike, computed, observe, autorun, when, reaction, action } from 'mobx' //isArrayLike 判断是否为数组a import {obse 阅读全文
posted @ 2020-09-28 15:41 陶智斌 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 在react安装 npm install react-router-dom --save //路由 npm install axios --save //axios npx create-react-app my-app --template typescript --use-npm npx :避免 阅读全文
posted @ 2020-07-28 09:23 陶智斌 阅读(203) 评论(0) 推荐(0) 编辑
摘要: actions:操作行为得处理模块,负责处理vue组件中接收到的所有得交互行为,包含同步/异步操作,支持多个同名方法,按照注册得顺序依次进行触发得,提供了对promise得封装,并且支持actions得链式触发,只是一个修饰器不能直接改变state值,通过提交mutations从而改变state值 阅读全文
posted @ 2020-07-04 14:35 陶智斌 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1、axios是一个基于promise来管理http请求得简洁、易用、高效得代码封装库 是一个能替代ajax得,能发送http接口请求得,并且是基于promise得一个管理异步得操作 2、特征: 从浏览器中创建XMLHttpRequest对象 从node中创建http请求 支持Promise 可以拦 阅读全文
posted @ 2020-06-24 23:35 陶智斌 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1、路由传值得实现方式 不局限于父子组件,任意得组件之间都可以进行传值使用路由 2、 配置路由文件index.js,告诉浏览器我要传一个什么参数 再router-link得to中设置要传的值是什么 传给谁就在哪个组件中进行数据得接收:this.$route.params.id $route:用来获取 阅读全文
posted @ 2020-06-24 22:13 陶智斌 阅读(439) 评论(0) 推荐(0) 编辑
摘要: import Vue from 'vue' import Router from 'vue-router' import Home from '@/components/Home' Vue.use(Router) const router = new Router({ mode: 'history' 阅读全文
posted @ 2020-06-24 21:57 陶智斌 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 1、路由: 官方提供一个插件,构建单页面应用,主要实现得功能页面得切换、组件得跳转 2、vue中得路由:vue-router包,如果是脚手架进行搭建得,那么是不需要安装vue-router这个包得,因为里边已经配置安装好了 3、scr中得router文件中的index.js就是直接放路由得文件,所有 阅读全文
posted @ 2020-06-18 23:10 陶智斌 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 1、对于vue来说,它有一个很强大得功能,就是指令系统 v-bind-->: v-on-->@ v-if、v-for、v-model 2、自定义指令 通过自定义指令来完成对DOM得更多操作,并且可以在不同得场景下给我们提供很方便得操作 全局指令:放到任何一个组件中都可以使用(需要把全局指令放在入口文 阅读全文
posted @ 2020-06-18 22:45 陶智斌 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 1、 transition:vue中得一个内置组件 实现得是组件得过渡效果 实现上:直接添加css得类名、使用钩子函数实现 2、 使用步骤: 用transition组件,把想要实现过渡效果得元素包裹起来 写上对应得实现过渡效果得css即可 3、t ransition实现原理: 1、会自动探查包裹得元 阅读全文
posted @ 2020-06-18 22:40 陶智斌 阅读(1197) 评论(0) 推荐(0) 编辑