上一页 1 2 3 4 5 6 7 8 9 ··· 44 下一页
摘要: 1,拆分组件 2,初始化页面渲染 Main 组件中有请求前,请求中,请求成功,请求失败四种状态,分别定义四个变量控制四种状态 3,Main 组件有 请求前,请求中,请求成功,请求失败 四种状态,故选择在 Main 组件中发送 ajax 请求更新状态,点击搜索时发布消息告诉Main发送请求,Main 阅读全文
posted @ 2021-02-01 23:29 shanlu 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 1,Home 组件下 有两个子路由组件:News.vue 和 Messages.vue 2,配置嵌套路由:route.js 3,路由链接:Home.vue 4,New 组件 5,Message 组件 阅读全文
posted @ 2021-02-01 23:27 shanlu 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 默认情况下,被切换的路由组件对象会死亡释放,再次回来时是重新创建的 如果可以缓存路由组件对象,可以提高用户体验 <keep-alive> <router-view></router-view> </keep-alive> 如输出框中的文本 123,若切换到其他组件再回到这个这个组件,输入框将会被清空 阅读全文
posted @ 2021-02-01 23:26 shanlu 阅读(659) 评论(0) 推荐(0) 编辑
摘要: 安装:npm install vuex --save 1,创建 store 对象--提供一个初始 state对象和一些 mutation store.js import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) //指定初始化数据 co 阅读全文
posted @ 2021-02-01 23:25 shanlu 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 1,创建 stores 文件夹,在其目录下分别创建 state actions mutations getters mutation-types 模块,以及集成这些模块向外暴露 store 对象的 index.js 模块 ① index.js ② state.js 2,完成 添加 todo ① mu 阅读全文
posted @ 2021-02-01 23:24 shanlu 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 使用聚合管道可以对集合中的文档进行变换和组合 用于表关联查询、数据的统计等。 MongoDB 使用 db.COLLECTION_NAME.aggregate([{<stage>} , ... ]) 方法来构建和使用聚合管道。 MongoDB Aaggregation 管道操作符与表达式: ① $pr 阅读全文
posted @ 2021-02-01 23:23 shanlu 阅读(508) 评论(0) 推荐(0) 编辑
摘要: 1,utils / storageUtil.js 2,state.js 3,actions.js 4,mutataion-type.js 5,mutataion.js 6,App.vue 中 页面初始化时异步获取 todos 7,页面重新加载时 阅读全文
posted @ 2021-02-01 23:22 shanlu 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 安装 MongoDB npm install mongodb --save 连接 MongoDB 数据库: //引入mongodb const {MongoClient} = require('mongodb') //定义数据库连接的地址 //const dataUrl = 'mongodb://1 阅读全文
posted @ 2021-02-01 23:20 shanlu 阅读(154) 评论(0) 推荐(0) 编辑
摘要: const http = require('http'); const Router = require('./Router') const {MongoClient} = require('mongodb') const ejs = require('ejs') const queryString 阅读全文
posted @ 2021-02-01 23:18 shanlu 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 1,在 node 下运行 npm install mockjs 使用: // 使用 Mock var Mock = require('mockjs') var data = Mock.mock({ // 属性 list 的值是一个数组,其中含有 1 到 10 个元素 'list|1-10': [{ 阅读全文
posted @ 2021-02-01 23:13 shanlu 阅读(706) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 44 下一页