摘要: super super(props): Superclass will help you to keep the props:[^props] import React, { Component } from "react"; export default class App extends Com 阅读全文
posted @ 2020-11-26 17:38 北冥雪 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Lifecycles[^lifecycles] getDerivedStateFromProps: Keeping the props always is the same as New props shouldComponentUpdate: We can control the componen 阅读全文
posted @ 2020-11-26 17:15 北冥雪 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 1、请求方式 axios(config) // 发送 POST 请求 axios({ method: 'post', url: '/user/12345', data: { firstName: 'Fred', lastName: 'Flintstone' } }); View Code 别名请求 阅读全文
posted @ 2020-08-20 23:00 北冥雪 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Vuex作用 自己实现变量共享可以通过Vue.prototype.shareObj = shareObj 来实现,但不是响应式 Vuex状态管理图 具体代码参考案例6 参考视频:https://www.bilibili.com/video/BV15741177Eh?p=128 1、Vuex的基本结构 阅读全文
posted @ 2020-08-20 17:41 北冥雪 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 参考视频:https://www.bilibili.com/video/BV15741177Eh?p=125 回调地狱 setTimeout(() => { console.log("Hello World"); setTimeout(() => { console.log("Hello Vue") 阅读全文
posted @ 2020-08-20 17:40 北冥雪 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 1、前端渲染后端渲染和前端路由后端路由 后端渲染和后端路由: 前端渲染: 前端路由: 2、vue-router的安装与配置 安装:npm install vue-router 配置: 1、导入路有对象,注册路由Vue.use(VueRouter) 2、创建实例并配置映射路径(new) 3、挂载路由( 阅读全文
posted @ 2020-08-15 23:06 北冥雪 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Webpack配置地狱 先留下参考视频:https://www.bilibili.com/video/BV15741177Eh?p=75 1、导入省略和别名设置 webpack.base.conf.js vueCil2: resolve: { extensions: ['.js', '.vue', 阅读全文
posted @ 2020-08-15 19:18 北冥雪 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 一、组件通信 (一)传值(两结合使用详见案例) 1、父传子:props(注意4个名字两两成对) 父组件:使用绑定把值传给子组件 子组件:通过props获取父组件传入的值(可以进行类型限制或默认值) <body> <div id="app"> <!-- 只能有一个root对象,所以数据的使用必须在一个 阅读全文
posted @ 2020-08-15 16:20 北冥雪 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 1、v-model使用 <body> <div id ="app"> <!-- 双向绑定 --> <input type="text" v-model="message"> {{message}} <br> <!-- v-model和radio的联合使用 --> <!-- 若变量有值则是默认一个 - 阅读全文
posted @ 2020-08-15 14:41 北冥雪 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 1、书馆购物案例 代码: <body> <div id="app"> <div v-if="books.length"> <table> <thead> <tr> <th></th> <th>书籍名称</th> <th>出版日期</th> <th>价格</th> <th>购买数量</th> <th> 阅读全文
posted @ 2020-06-27 20:29 北冥雪 阅读(390) 评论(0) 推荐(0) 编辑