- vue IE因Promise无法显示解决办法
Yao请输入昵称
一、ie11打开vue2.0项目空白,控制台报错vuexrequiresaPromisepolyfillinthisbrowserPromise为ES6语法,有的浏览器不支持ES6,所以需要安装babel-polyfill来将ES6转换为浏览器可识别的ES5语法①npminstall--save-devbabel-polyfill②在main.js中引入import"babel-polyfill"
- 看Vue2.0及数字商城电商开发
一包
Vue2.0在标签中可以使用驼峰命名法,区分大小写ES6语法1:components:{componentA}等价于components:{componentA:componentA}ES6语法2:methods:{add(){}}等价于methods:{add:function(){}}数组更新检测:变异方法:Vue包含一组观察数组的变异方法,所以它们也将会触发视图更新。push()pop()s
- Vue2.0 插槽 Slot
weixin_46913268
vue
一、插槽概述作用:让父组件可以向子组件指定位置插入html结构,也是一种组件间的通信方式,适用于父组件到子组件分类:分类:默认插槽、具名插槽、作用域插槽二、默认插槽的使用父组件默认插槽importDefaultSlotfrom"@/components/defaultSlot.vue";exportdefault{name:"ParentBox",components:{DefaultSlot,}
- 搭建vue2.0工程步骤
鼠年大吉
vue
搭建Vue2项目的具体步骤如下:确保已安装Node.js和npm。你可以在终端窗口中运行以下命令来检查是否已安装:node-vnpm-v如果没有安装,可从Node.js官网(https://nodejs.org/)下载并安装。在终端窗口中,通过以下命令安装VueCLI工具:npminstall-g@vue/cli创建新的Vue项目。在终端窗口中运行以下命令:vuecreate项目名称例如,如果你的
- Vue2.0
WYONG_ZQ
java
Vue2.0饿了么ElementUI:http://element.eleme.io/#/zh-CN/component/installation?Vue2.0从环境搭建到发布:http://blog.csdn.net/sinat_17775997/article/details/52788908Vue官方教程及api:http://cn.vuejs.org/v2/guide/ES6入门教程:ht
- Vue2.0学习--基础--4--Class与Style绑定
naildingding
框架—Vuevue前端
(day5)操作元素的class列表和内联样式是数据绑定的一个常见需求。因为它们都是attribute(也就是每个元素的class属性和style属性),所以我们可以用v-bind处理它们:只需要表达式计算出字符串结果即可。(也就是说,在HTML中class和style属性后面都是接一个双引号括起来的字符串值)但是字符串拼接麻烦且易错。所以,在使用v-bind将class与style与特定的值绑定
- vue2.0 引入font-awesome
LI_4058
第一步:安装依赖npminstallfont-awesome--save第二步:然后在main.js引入font-awesome/css/font-awesome.min.css即可import'font-awesome/css/font-awesome.min.css'
- ElementUI +++ Echarts面试题&答案汇总
阿金要当大魔王~~
面试啊elementui前端javascript
官网地址:http://element-cn.eleme.io/#/zh-CNElementUI是一套基于VUE2.0的桌面端组件库,ElementUI提供了丰富的组件帮助开发人员快速构建功能强大、风格统一的页面。ElementUi是怎么做表单验证的?在循环里对每个input验证怎么做呢?model绑定表单数据,通过prop取表单数值,通过编写ref进行后台API验证,根据rules进行表单内容验
- vue2.0和vue3.0v-model使用对比
糖小羊儿
我们在写项目的时候,经常自定义组件,并且需要传参,刚好v-model是一个双向绑定,所以我们会把v-model的思想使用到各个自定义组件中在vue2.0中,v-model只能对应一个变量在vue3.0中,在v-model原来的使用基础上,拓展了多对多的使用方式1.vue2.0父组件引入子组件hello,并且传参给子组件,代码如下:{{username}}importhellofrom"@/comp
- 【Vue学习笔记】尚硅谷Vue2.0+Vue3.0全套教程丨vue.js从入门到精通
丁咚Dingdong
学习笔记前端Vue2.xVue3.0Vue
尚硅谷Vue2.0+Vue3.0全套教程丨vue.js从入门到精通Vue2.0部分1.Vue核心部分1.1Vue简介1.1.1Vue是什么?1.1.2Vue作者1.1.3Vue的特点1.1.4Vue学习的JavaScript前备知识点1.1.5Vue使用指南1.1.6搭建Vue开发环境1.2初识Vue1.2.1Hello小实例1.2.2分析Hello案例1.3Vue模板语法1.4数据绑定1.5el
- 关于vue安装less和webpack版本冲突问题
SepstoneTang
vue.js
关于vue2.0安装less和webpack版本冲突问题1.学会查看自己webpack和less指令2.默认安装less-loader命令3.解决办法1.学会查看自己webpack和less指令查看当前webpack版本npmviewwebpackversion查看当前webpack所有版本npmviewwebpackversions不建议使用太新版本的2.默认安装less-loader命令npm
- 如何封装一个简单的VUE组件
youmatech
vue.jsjavascript前端
基于vue2.0封装一个简单的表单组件前景介绍准备工作准备编码前景介绍这是一篇晚来的文章,毕竟2.0在去年12月份就已经停止维护了,这篇文章当是一个纪念吧。准备工作我们封装组件最快速的就是使用脚手架创建一个项目$vuecreatemy-demo下面选择vue2即可,其他的随意,建议关闭eslint,这样在编写的时候会比较简单。准备编码下面我们创建一个组件UmInput(前缀并没有要求,可以随意起)
- 【Web - 框架 - Vue】随笔 - 通过`CDN`的方式使用`VUE 2.0`和`Element UI`
SUNxRUN
前端vue.jsui
通过CDN的方式使用VUE2.0和ElementUIVUE网址https://cdn.bootcdn.net/ajax/libs/vue/2.7.16/vue.js源码https://download.csdn.net/download/HIGK_365/88815507测试代码Title{{info}}letv=newVue({el:"div",data:{info:"HelloVue!"}})
- Vue2.5学习路线及基础知识总结。
dingqing4356
javascriptViewUI
在接触新技术不了解时,我喜欢去慕课网上看新手教程,在学习vue时,在慕课网上看了几个老师的视频,发现这挺好,讲到挺详细的,适合新手,有兴趣的可以先看一下,vue2.5入门教程。然后在学习路上看见了一篇文章就是讲解学习vue2.0路线的文章,Vue2.0建议学习路线。还有vue原作者尤雨溪大神,在知乎上写到的Vue2.0建议学习顺序。这里面的建议还是很实用的。这里我也不再去写了,写了也没那么专业,给
- 1.Vue-resource(Vue2.0推荐使用 axios 来完成 ajax 请求)
Victor_b905
一、vue-resource特点1、体积小:vue-resource非常小巧,在压缩以后只有大约12KB,服务端启用gzip压缩后只有4.5KB大小,这远比jQuery的体积要小得多。2、支持主流浏览器:和Vue.js一样,vue-resource除了不支持IE9以下的浏览器,其他主流的浏览器都支持3、支持PromiseAPI和URITemplates:Promise是ES6的特性,Promise
- 推荐好用的vue插件02 v-md-editor富文本编辑器
longbao_1
前端vue.jsgithubjavascript
一、介绍v-md-editor是基于Vue开发的markdown编辑器组件二、安装与注册即支持vue2.0的项目也支持vue3.0的项目,不过两种版本的安装版本不同-[Demo](https://code-farmer-i.github.io/vue-markdown-editor/examples/base-editor.html)-[Documentation](https://code-fa
- 开源Vue UI框架
初学小白Lu
前端开源vue.jsui
文章目录ElementUIElementPlusVuetifyiViewViewUIPlusQuasarAntDesignVueBuefyvue-materialDevUITinyVuenutuitdesign-vuearco-design-vueNaiveUIBootstrapVueElementUIElementUI是一套为开发者、设计师和产品经理准备的基于Vue2.0的组件库,提供了丰富的组
- 前端案例:基于el-table和el-pagination实现数据的分页效果
m0_67401746
前端htmlvue.jsjavascript前端
首先使用el-table(表格)和el-pagination(分页)组件需要npm下载ElementUI组件库,下载安装方式参见官网:Element-Theworld’smostpopularVueUIframeworkElement,一套为开发者、设计师和产品经理准备的基于Vue2.0的桌面端组件库[这里是图片001]https://element.eleme.cn/#/zh-CN/compon
- 5.4 Vue2.0 动态组件&插槽&自定义指令&自定义插件
像我这样的人112
前端学习笔记前端javascriptvue.js
文章目录动态组件1,什么是动态组件2,如何实现动态组件的渲染3,使用``保持状态4,``对应的生命周期函数5,的`include`和`exclude`属性插槽1,默认插槽2,具名插槽3,作用域插槽自定义指令私有自定义指令update函数函数简写全局自定义指令自定义插件动态组件1,什么是动态组件动态组件指的是动态切换组件的显示与隐藏。2,如何实现动态组件的渲染vue提供了一个内置的组件,专门用来实现
- vue2.0第五节:动态组件 & 插槽 & 自定义指令
不能瞌睡呀
vuejavascriptvue.js前端
文章目录学习目标1.动态组件1.1.什么是动态组件1.2.如何实现动态组件渲染1.3.使用keep-alive保持状态1.4.keep-alive对应的生命周期函数1.5.keep-alive的include属性了解组件注册名称和组件声明时name的区别2.插槽2.1.什么是插槽2.2.体验插槽的基础用法2.2.1没有预留插槽的内容会被丢弃2.2.2后备内容2.3.具名插槽2.3.1为具名插槽提供
- 【vue篇】第五话--动态组件 & 插槽 & 自定义指令
陪我吹吹海風吧
vue.jsvue.jsjavascript前端
作者简介:大家好!我是陪我吹吹海風吧。喜欢:点赞收藏!持续更新vue2.0/3.0✊加油,共勉!目录✍一、动态组件1.什么是动态组件2.如何实现动态组件渲染3.使用keep-alive保持状态4.keep-alive对应的生命周期函数5.keep-alive的include属性✍二、插槽1.什么是插槽2.v-slot2.1v-slot的基本使用2.2v-slot的简写是#3.具名插槽4.作用域插槽
- vue3.0 Composition API上手体验
廊坊吴彦祖
vuevue3.0CompositionAPIvuevue-cli4
vue3.0CompositionAPI上手体验vue3.0对比vue2.0优势vue3.0相比vue2.0性能提升了近50%,框架内部做了大量性能优化,包括:虚拟dom,编译模板,Proxy的新数据监听,更小的打包文件等vue3.0新的组合式API(即CompositionAPI)根据逻辑相关性组织代码,相比于vue2.0的OptionsAPI,提高了代码的可读性和可维护性,更适合大型项目的编写
- Vue2.0 组件传值方式:父传子、子传父、非父子组件传值
博客zhu虎康
遇见Bug_Vuejsvue.js
文章目录1.父组件向子组件进行传值父组件:子组件:2.子组件向父组件传值子组件:父组件:3.非父子组件进行传值公共bus.js组件A:组件B:每次总结都是在加强一遍记忆1.父组件向子组件进行传值父组件:父组件:importchildfrom'./child'exportdefault{components:{child},data(){return{name:''}}}子组件:子组件:{{inpu
- Vue2.0 修饰符、绑定样式、计算属性以及侦听属性
前端小白李小小
vue.js前端javascript
一、修饰符1.事件修饰符:事件修饰符是对事件捕获以及目标进行了处理(语法:@事件名.修饰符)(1)stop:阻止了事件冒泡,相当于调用了event.stopPropagation方法(2)prevent:阻止了事件默认行为,相当于调用了event.preventDefault方法(3)self:只有在event.target是当前元素自身时触发(4)once:绑定的事件只能触发一次(5)captu
- Vue2.0 | 将项目打包成exe文件
FSYML
#Vue2.0vue.jsnode.js
本篇目录1.安装pkg2.下载项目依赖3.初始化并安装express包4.开始打包5.打包完成6.问题处理6.1打包过程报错附录1.手动下载node二进制文件前期准备:确保本地网络可以访问Github。确保本地正确安装NodeJs,可使用node-v查看版本。确保待打包项目可正常运行。本篇NodeJs版本v14.15.1。本篇介绍使用pkg插件将Vue项目打包成exe文件;前期准备完成之后,cmd
- 05-mac vue2.0升级到vue3.0+
高家_大少爷
在创建cli项目时,执行npmcreate项目名;注意名最好是英文开头最好是小写;npmcreate命令是基于vue.3.0版本以上使用的,检查cli版本号vue-V;先卸载原有的clinpmuninstallvue-cli-g//卸载原有clinpminstall-g@vue/cli//安装新版本cli以上是没有出现问题,当有问题时,当你卸载vue.cli时会出现uptotimein0.14s,
- vue2.0—路由嵌套和路由传参
杀个程序猿祭天
vue2.0—路由传参构建项目和创建组件就不细说了,不懂的可以去官方文档API学习VUE官方文档:https://cn.vuejs.org/v2/guide/vue2.0路由传参一共有两种放法1.创建组件home和child,并且在home组件中定义路由//home.vue新闻一2.配置路由//router.jsimportVuefrom'vue'importRouterfrom'vue-rout
- 手写 vue3 Proxy reactive 双向绑定原理
前端酱紫
vue3.0javascripthtmlvue3
Proxy代理对象Vue3Proxy双向绑定原理一定要触发set,才能够修改到界面的数据。因为Object.defineproperty如果对象是数组,不会触发set,所以在vue2.0中,数组并不是响应式的。因为newProxy可以对数组进行代理,修改数组中数据的时候,也会触发set,一旦触发set,就可以在set中修改界面的数据,做到响应式效果Documentletobj={txtVal:'输
- vue2.0中的$router 和 $route的区别
为光pig
vue-router中经常会操作的两个对象route和router两个。1、$route对象$route对象表示当前的路由信息,包含了当前URL解析得到的信息。包含当前的路径,参数,query对象等$route.path字符串,对应当前路由的路径,总是解析为绝对路径,如"/foo/bar"。$route.params一个key/value对象,包含了动态片段和全匹配片段,如果没有路由参数,就是一个
- mall 项目随笔
coderlion
项目介绍技术栈Vue2.0(核心框架)Vue-CLI4.0(Vue脚手架)Vue-Router(SPA页面路由)Vuex(状态管理)Axios(网络请求)ES6(JavaScript语言的下一代标准)Less(CSS预处理器)Better-Scroll(让移动端的滚动更为流畅)FastClick(解决移动端点击300ms延迟)Vue-Lazyload(懒加载工具)PostCss(css代码转化工具
- SQL的各种连接查询
xieke90
UNION ALLUNION外连接内连接JOIN
一、内连接
概念:内连接就是使用比较运算符根据每个表共有的列的值匹配两个表中的行。
内连接(join 或者inner join )
SQL语法:
select * fron
- java编程思想--复用类
百合不是茶
java继承代理组合final类
复用类看着标题都不知道是什么,再加上java编程思想翻译的比价难懂,所以知道现在才看这本软件界的奇书
一:组合语法:就是将对象的引用放到新类中即可
代码:
package com.wj.reuse;
/**
*
* @author Administrator 组
- [开源与生态系统]国产CPU的生态系统
comsci
cpu
计算机要从娃娃抓起...而孩子最喜欢玩游戏....
要让国产CPU在国内市场形成自己的生态系统和产业链,国家和企业就不能够忘记游戏这个非常关键的环节....
投入一些资金和资源,人力和政策,让游
- JVM内存区域划分Eden Space、Survivor Space、Tenured Gen,Perm Gen解释
商人shang
jvm内存
jvm区域总体分两类,heap区和非heap区。heap区又分:Eden Space(伊甸园)、Survivor Space(幸存者区)、Tenured Gen(老年代-养老区)。 非heap区又分:Code Cache(代码缓存区)、Perm Gen(永久代)、Jvm Stack(java虚拟机栈)、Local Method Statck(本地方法栈)。
HotSpot虚拟机GC算法采用分代收
- 页面上调用 QQ
oloz
qq
<A href="tencent://message/?uin=707321921&Site=有事Q我&Menu=yes">
<img style="border:0px;" src=http://wpa.qq.com/pa?p=1:707321921:1></a>
- 一些问题
文强chu
问题
1.eclipse 导出 doc 出现“The Javadoc command does not exist.” javadoc command 选择 jdk/bin/javadoc.exe 2.tomcate 配置 web 项目 .....
SQL:3.mysql * 必须得放前面 否则 select&nbs
- 生活没有安全感
小桔子
生活孤独安全感
圈子好小,身边朋友没几个,交心的更是少之又少。在深圳,除了男朋友,没几个亲密的人。不知不觉男朋友成了唯一的依靠,毫不夸张的说,业余生活的全部。现在感情好,也很幸福的。但是说不准难免人心会变嘛,不发生什么大家都乐融融,发生什么很难处理。我想说如果不幸被分手(无论原因如何),生活难免变化很大,在深圳,我没交心的朋友。明
- php 基础语法
aichenglong
php 基本语法
1 .1 php变量必须以$开头
<?php
$a=” b”;
echo
?>
1 .2 php基本数据库类型 Integer float/double Boolean string
1 .3 复合数据类型 数组array和对象 object
1 .4 特殊数据类型 null 资源类型(resource) $co
- mybatis tools 配置详解
AILIKES
mybatis
MyBatis Generator中文文档
MyBatis Generator中文文档地址:
http://generator.sturgeon.mopaas.com/
该中文文档由于尽可能和原文内容一致,所以有些地方如果不熟悉,看中文版的文档的也会有一定的障碍,所以本章根据该中文文档以及实际应用,使用通俗的语言来讲解详细的配置。
本文使用Markdown进行编辑,但是博客显示效
- 继承与多态的探讨
百合不是茶
JAVA面向对象 继承 对象
继承 extends 多态
继承是面向对象最经常使用的特征之一:继承语法是通过继承发、基类的域和方法 //继承就是从现有的类中生成一个新的类,这个新类拥有现有类的所有extends是使用继承的关键字:
在A类中定义属性和方法;
class A{
//定义属性
int age;
//定义方法
public void go
- JS的undefined与null的实例
bijian1013
JavaScriptJavaScript
<form name="theform" id="theform">
</form>
<script language="javascript">
var a
alert(typeof(b)); //这里提示undefined
if(theform.datas
- TDD实践(一)
bijian1013
java敏捷TDD
一.TDD概述
TDD:测试驱动开发,它的基本思想就是在开发功能代码之前,先编写测试代码。也就是说在明确要开发某个功能后,首先思考如何对这个功能进行测试,并完成测试代码的编写,然后编写相关的代码满足这些测试用例。然后循环进行添加其他功能,直到完全部功能的开发。
- [Maven学习笔记十]Maven Profile与资源文件过滤器
bit1129
maven
什么是Maven Profile
Maven Profile的含义是针对编译打包环境和编译打包目的配置定制,可以在不同的环境上选择相应的配置,例如DB信息,可以根据是为开发环境编译打包,还是为生产环境编译打包,动态的选择正确的DB配置信息
Profile的激活机制
1.Profile可以手工激活,比如在Intellij Idea的Maven Project视图中可以选择一个P
- 【Hive八】Hive用户自定义生成表函数(UDTF)
bit1129
hive
1. 什么是UDTF
UDTF,是User Defined Table-Generating Functions,一眼看上去,貌似是用户自定义生成表函数,这个生成表不应该理解为生成了一个HQL Table, 貌似更应该理解为生成了类似关系表的二维行数据集
2. 如何实现UDTF
继承org.apache.hadoop.hive.ql.udf.generic
- tfs restful api 加auth 2.0认计
ronin47
目前思考如何给tfs的ngx-tfs api增加安全性。有如下两点:
一是基于客户端的ip设置。这个比较容易实现。
二是基于OAuth2.0认证,这个需要lua,实现起来相对于一来说,有些难度。
现在重点介绍第二种方法实现思路。
前言:我们使用Nginx的Lua中间件建立了OAuth2认证和授权层。如果你也有此打算,阅读下面的文档,实现自动化并获得收益。SeatGe
- jdk环境变量配置
byalias
javajdk
进行java开发,首先要安装jdk,安装了jdk后还要进行环境变量配置:
1、下载jdk(http://java.sun.com/javase/downloads/index.jsp),我下载的版本是:jdk-7u79-windows-x64.exe
2、安装jdk-7u79-windows-x64.exe
3、配置环境变量:右击"计算机"-->&quo
- 《代码大全》表驱动法-Table Driven Approach-2
bylijinnan
java
package com.ljn.base;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.uti
- SQL 数值四舍五入 小数点后保留2位
chicony
四舍五入
1.round() 函数是四舍五入用,第一个参数是我们要被操作的数据,第二个参数是设置我们四舍五入之后小数点后显示几位。
2.numeric 函数的2个参数,第一个表示数据长度,第二个参数表示小数点后位数。
例如:
select cast(round(12.5,2) as numeric(5,2))  
- c++运算符重载
CrazyMizzz
C++
一、加+,减-,乘*,除/ 的运算符重载
Rational operator*(const Rational &x) const{
return Rational(x.a * this->a);
}
在这里只写乘法的,加减除的写法类似
二、<<输出,>>输入的运算符重载
&nb
- hive DDL语法汇总
daizj
hive修改列DDL修改表
hive DDL语法汇总
1、对表重命名
hive> ALTER TABLE table_name RENAME TO new_table_name;
2、修改表备注
hive> ALTER TABLE table_name SET TBLPROPERTIES ('comment' = new_comm
- jbox使用说明
dcj3sjt126com
Web
参考网址:http://www.kudystudio.com/jbox/jbox-demo.html jBox v2.3 beta [
点击下载]
技术交流QQGroup:172543951 100521167
[2011-11-11] jBox v2.3 正式版
- [调整&修复] IE6下有iframe或页面有active、applet控件
- UISegmentedControl 开发笔记
dcj3sjt126com
// typedef NS_ENUM(NSInteger, UISegmentedControlStyle) {
// UISegmentedControlStylePlain, // large plain
&
- Slick生成表映射文件
ekian
scala
Scala添加SLICK进行数据库操作,需在sbt文件上添加slick-codegen包
"com.typesafe.slick" %% "slick-codegen" % slickVersion
因为我是连接SQL Server数据库,还需添加slick-extensions,jtds包
"com.typesa
- ES-TEST
gengzg
test
package com.MarkNum;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.annotation
- 为何外键不再推荐使用
hugh.wang
mysqlDB
表的关联,是一种逻辑关系,并不需要进行物理上的“硬关联”,而且你所期望的关联,其实只是其数据上存在一定的联系而已,而这种联系实际上是在设计之初就定义好的固有逻辑。
在业务代码中实现的时候,只要按照设计之初的这种固有关联逻辑来处理数据即可,并不需要在数据库层面进行“硬关联”,因为在数据库层面通过使用外键的方式进行“硬关联”,会带来很多额外的资源消耗来进行一致性和完整性校验,即使很多时候我们并不
- 领域驱动设计
julyflame
VODAO设计模式DTOpo
概念:
VO(View Object):视图对象,用于展示层,它的作用是把某个指定页面(或组件)的所有数据封装起来。
DTO(Data Transfer Object):数据传输对象,这个概念来源于J2EE的设计模式,原来的目的是为了EJB的分布式应用提供粗粒度的数据实体,以减少分布式调用的次数,从而提高分布式调用的性能和降低网络负载,但在这里,我泛指用于展示层与服务层之间的数据传输对
- 单例设计模式
hm4123660
javaSingleton单例设计模式懒汉式饿汉式
单例模式是一种常用的软件设计模式。在它的核心结构中只包含一个被称为单例类的特殊类。通过单例模式可以保证系统中一个类只有一个实例而且该实例易于外界访问,从而方便对实例个数的控制并节约系统源。如果希望在系统中某个类的对象只能存在一个,单例模式是最好的解决方案。
&nb
- logback
zhb8015
loglogback
一、logback的介绍
Logback是由log4j创始人设计的又一个开源日志组件。logback当前分成三个模块:logback-core,logback- classic和logback-access。logback-core是其它两个模块的基础模块。logback-classic是log4j的一个 改良版本。此外logback-class
- 整合Kafka到Spark Streaming——代码示例和挑战
Stark_Summer
sparkstormzookeeperPARALLELISMprocessing
作者Michael G. Noll是瑞士的一位工程师和研究员,效力于Verisign,是Verisign实验室的大规模数据分析基础设施(基础Hadoop)的技术主管。本文,Michael详细的演示了如何将Kafka整合到Spark Streaming中。 期间, Michael还提到了将Kafka整合到 Spark Streaming中的一些现状,非常值得阅读,虽然有一些信息在Spark 1.2版
- spring-master-slave-commondao
王新春
DAOspringdataSourceslavemaster
互联网的web项目,都有个特点:请求的并发量高,其中请求最耗时的db操作,又是系统优化的重中之重。
为此,往往搭建 db的 一主多从库的 数据库架构。作为web的DAO层,要保证针对主库进行写操作,对多个从库进行读操作。当然在一些请求中,为了避免主从复制的延迟导致的数据不一致性,部分的读操作也要到主库上。(这种需求一般通过业务垂直分开,比如下单业务的代码所部署的机器,读去应该也要从主库读取数