mpVue小程序全栈开发
1、微信小程序,mpVue和wepy的对比

2、

3、es6中关于数组的一些方法
<script>
let arr = [,,,]
// 遍历
arr.forEach(v => {
console.log(v)
})
// 循环操作
console.log(arr.map(v => v*))
// 循环判断
console.log(arr.every(v => v > ))
// 过滤
console.log(arr.filter(v => v <= ))
// 数组去重
let arr1 = [,,,,,]
let arr2 = [,,,]
console.log([...new Set(arr1)])
// 并集
console.log(arr1.concat(arr2))
19 // 去重并集
console.log([...new Set([...arr1,...arr2])])
</script>

arr.foreach 遍历
arr.map 按顺序进行操作 返回一个数组
arr.every every() 方法测试数组的所有元素是否都通过了指定函数的测试。 https://www.cnblogs.com/leejersey/p/5483247.html
4、小程序生命周期
https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/app.html
5、初始化一个mpvue项目
http://mpvue.com/mpvue/quickstart/
# . 全局安装 vue-cli
# 一般是要 sudo 权限的
$ npm install --global vue-cli # . 创建一个基于 mpvue-quickstart 模板的新项目
# 新手一路回车选择默认就可以了
$ vue init mpvue/mpvue-quickstart my-project # . 安装依赖,走你
$ cd my-project
$ npm install
$ npm run dev
npm run dev启动项目后 用微信小程序开发工具打开项目 就可以自动运行
6、mpvue项目结构

7、mpVue中的生命周期

主要是用Vue的生命周期,Created创建初始化。Vue没有的生命周期,就用小程序自己的


8、koa的一些知识

ctx是什么?
是封装了request和response的上下文
next是什么?
下一个中间件
app是什么?
启动应用
koa中的中间件

类似洋葱一样的圆环,从中间件1,2,3进入,再从3,2,1出来,得到最后的响应结果,因为是圆环状的,所以可以得到网络请求之前或之后的内容

结果是:135642
9、回调地狱,Promise,async+await
function ajax(fn) {
setTimeout(() => {
console.log('你好')
fn()
}, )
}
// 回调地狱
ajax(()=>{
console.log('执行结束')
ajax(()=>{
ajax(()=>{
ajax(()=>{
console.log('执行结束3')
})
})
console.log('执行结束2')
})
})
// 你好
// 执行结束
// 你好
// 执行结束2
// 你好
// 你好
// 执行结束3
function delay(word) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(word)
}, )
})
}
// 使用Promise
delay('孙悟空')
.then((word) => {
console.log(word)
return delay('猪八戒')
})
.then((word) => {
console.log(word)
return delay('沙僧')
})
.then((word) => {
console.log(word)
})
// saync+await一起使用
async function start() {
const word1 = await delay('孙悟空')
console.log(word1)
const word2 = await delay('猪八戒')
console.log(word2)
const word3 = await delay('沙僧')
console.log(word3)
}
start()
// 孙悟空
// 猪八戒
// 沙僧
第一个就是回调地狱,外层的请求结果是内层的参数, 代码可读性差,错误不易处理
Promise就是用来处理异步请求的
async+await 是Promise的语法糖
为什么使用async+await
https://cnodejs.org/topic/58e4914e43ee7e7106c13541
10、






11、
腾讯云常见问题:https://cloud.tencent.com/document/product/619/11442
https://coding.imooc.com/lesson/218.html#mid=14305
秘钥:https://console.cloud.tencent.com/cam/capi
APPid:https://console.cloud.tencent.com/developer
12、微信小程序 请求的url如果报下面的错

解决办法是,在微信小程序工具中,点击详情,选中下面的

13、eslint: await is a reserved word的解决办法

解决办法:

14、微信小程序后台
https://developers.weixin.qq.com/miniprogram/dev/qcloud/qcloud.html#通过微信公众平台授权登录腾讯云

微信公众平台
https://mp.weixin.qq.com/wxopen/initprofile?action=home&lang=zh_CN&token=1777431014
腾讯云
https://mp.weixin.qq.com/wxopen/thirdtools?action=index&token=1777431014&lang=zh_CN

腾讯云后台管理
https://console.qcloud.com/lav2/dev
这里面有关于腾讯云的各种API

腾讯云服务端SDK API wafer2-node-sdk
Wafer 服务端 SDK 是腾讯云为微信小程序开发者提供的快速开发库
https://github.com/tencentyun/wafer2-node-sdk/blob/master/README.md
腾讯云相关文档
https://developers.weixin.qq.com/miniprogram/dev/qcloud/qcloud.html#其他具体开发文档

15、Mpvue课程问答区总结帖
http://www.imooc.com/article/31092
16、获取到用户信息后,用户信息是如何存入mysql数据库 的
https://coding.imooc.com/learn/questiondetail/60293.html
17、微信小程序要实现下拉刷新,需要在json里面配置enablePullDownRefresh
https://developers.weixin.qq.com/miniprogram/dev/framework/config.html

下拉刷新的时候会触发onPullDownRefresh事件
https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/page.html


在mpvue中,要配置的话,在main.js里面

export default {
config: {
enablePullDownRefresh: true
}
}

18、8-7 图书访问次数统计
mpveu中获取传递的options http://mpvue.com/mpvue/#_18
1. 如何获取小程序在 page onLoad 时候传递的 options
在所有 页面 的组件内可以通过 this.$root.$mp.query 进行获取。
19、9-5 手机型号
获取手机的信息 https://developers.weixin.qq.com/miniprogram/dev/api/systeminfo.html

20. 9-10 (分享功能,使用了button)
button组件 https://developers.weixin.qq.com/miniprogram/dev/component/button.html

mpVue小程序全栈开发的更多相关文章
- 全栈开发工程师微信小程序-中(下)
全栈开发工程师微信小程序-中(下) 微信小程序视图层 wxml用于描述页面的结构,wxss用于描述页面的样式,组件用于视图的基本组成单元. // 绑定数据 index.wxml <view> ...
- 全栈开发工程师微信小程序-中(中)
全栈开发工程师微信小程序-中(中) 开放能力 open-data 用于展示微信开放的数据 type 开放数据类型 open-gid 当 type="groupName" 时生效, ...
- 全栈开发工程师微信小程序-中
全栈开发工程师微信小程序-中 多媒体及其他的组件 navigator 页面链接 target 在哪个目标上发生跳转,默认当前小程序,可选值self/miniProgram url 当前小程序内的跳转链 ...
- 全栈开发工程师微信小程序-上(下)
全栈开发工程师微信小程序-上(下) icon 图标 success, success_no_circle, info, warn, waiting, cancel, download, search, ...
- 全栈开发工程师微信小程序-上(中)
全栈开发工程师微信小程序-上(中) width: 750rpx; 750rpx代表与屏幕等宽,rpx的缩写responsive pixel,这个单位是可以根据屏幕大小进行自适应调整的像素单位. 小程序 ...
- 全栈开发工程师微信小程序 - 上
全栈开发工程师微信小程序-上 实现swiper组件 swiper 滑块视图容器. indicator-dots 是否显示面板指示点 false indicator-color 指示点颜色 indica ...
- Slog71_选取、上传和显示本地图片GET !(微信小程序之云开发-全栈时代3)
ArthurSlog SLog-71 Year·1 Guangzhou·China Sep 12th 2018 ArthurSlog Page GitHub NPM Package Page 掘金主页 ...
- 第一个mpvue小程序开发总结
前言 说起小程序,其实在去年我都还只试着照着官方文档写过demo的,不过现在这家公司小程序做得比较多,我来之后也参与了几个小程序的开发了,最开始那几个是用的wepy,最近一个开始转用mpvue开发,最 ...
- mpvue 小程序开发之 数据埋点统计
mpvue 小程序开发之 数据埋点统计 在开发过程中,有数据统计的需求,需要获取小程序当前页面和来源页面的数据,以及页面的停留时间 在对小程序api进行了一番研究之后,发现获取这些数据其实并不难 当前 ...
随机推荐
- cookies 不同端口 是可以共享的
cookies 不同端口,是跨域吗? 我部署了两套系统在同一个ip上!8080,和8090! 这样.cookies,算跨域吗? 两套系统都记录了都有一个 historyItem的key的cookies ...
- maven install deploy tell us heap is full
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compi ...
- MySQL索引原理及慢查询优化-来自美团网的技术blog(写的深入浅出)
MySQL索引原理及慢查询优化 转:http://tech.meituan.com/mysql-index.html MySQL凭借着出色的性能.低廉的成本.丰富的资源,已经成为绝大多数互联网公司的首 ...
- js鼠标移入移出效果【原】
<HTML> <HEAD> <!-- meta 解释 : http://www.haorooms.com/post/html_meta_ds --> <met ...
- golang struct tag
golang可以在struct中的每个字段,写上一个tag.这个tag可以通过反射的机制获取到,最常用的场景就是json序列化和反序列化 package main import ( "enc ...
- clip:rect()
写进度条的时候用过这个方法,记录一下 它的用法是 .test{ clip: rect(<top>, <right>, <bottom>, <>left) ...
- IIC AT24C02读写数据的一点小体会
一.写数据 unsigned char I2CWriteByte(unsigned int mem_addr,unsigned char*DDATAp,unsigned int count) { u8 ...
- C++中返回值
函数的返回值用于初始化在调用函数是创建的临时对象. 1.返回值为非引用类型: 会将函数的返回值复制给临时对象.跟实参初始化形参的方式一样. 2.返回值为引用类型: 没有复制返回值,返回的是对象本身.返 ...
- android 短信拦截
android 4+版本需要用户主动添加broadReceiver 1.清单文件 <manifest xmlns:android="http://schemas.android.com ...
- Centos7编译hadoop异常:Received fatal alert: handshake_failure
保持网络畅通 或者 配置代理 能够访问cdh的仓库 https://repository.cloudera.com/artifactory/cloudera-repos/ 编译hadoop版本 had ...