摘要: 表单提交,文件上传是一个常用又十分麻烦的功能,以前要上传文件通常都是借助插件或者flash来实现,噼里啪啦的加载一大堆东西。自从有了HTML5的FormData后。 FormData可以把它理解成一个虚拟的表单对象,它只有一个方法append,这个可以在浏览器console一下就知道了。我们可以通过 阅读全文
posted @ 2017-08-11 23:52 sungang 阅读(100) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head> <title>父子组件</title> <script type="text/javascript" src="vue 2.js"></script></head><body><div id="box"> <com-a></com-a> <co 阅读全文
posted @ 2017-05-23 16:43 sungang 阅读(1966) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head> <title>slot</title><script type="text/javascript" src="vue.js"></script> </head><body><div id="box"> <aaa> <ul slot="ul-sl 阅读全文
posted @ 2017-05-22 16:33 sungang 阅读(155) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head> <title>选择</title> <script type="text/javascript" src="vue.js"></script></head><body><div id="box"> <ul> <li v-for="(index, 阅读全文
posted @ 2017-05-22 16:28 sungang 阅读(343) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head> <title>父子组件</title> <script type="text/javascript" src="vue.js"></script></head><body><div id="box"> <my-aaa></my-aaa></di 阅读全文
posted @ 2017-05-22 14:37 sungang 阅读(142) 评论(0) 推荐(0) 编辑
摘要: <div id="box"> <input type="button" value="aaa组件" @click="aaa" /> <input type="button" value="bbb组件" @click="bbb" /> <component :is='a'></component></ 阅读全文
posted @ 2017-05-19 15:04 sungang 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 组件为:aaa <div id="box"> <aaa></aaa></div> 局部组件数据事件: var vm=new Vue({ el:"#box", data:{ a:"aaa" }, components:{ 'aaa':{ data(){ return { msg:"wo是msg哦" } 阅读全文
posted @ 2017-05-19 14:30 sungang 阅读(318) 评论(0) 推荐(0) 编辑
摘要: vuejs: Vue.directive('drag',function(){ var oDiv=this.el; oDiv.onmousedown=function(ev){ var disX=ev.clientX-oDiv.offsetLeft; var disY=ev.clientY-oDiv 阅读全文
posted @ 2017-05-18 17:25 sungang 阅读(231) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>拖拽效果</title> <style type="text/css"> body{ ba 阅读全文
posted @ 2017-04-25 11:46 sungang 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 文件上传对象:class upload{ protected $fileName; protected $uploadPath; protected $imgFlag; protected $maxSize; protected $allowExt; protected $allowMime; pr 阅读全文
posted @ 2017-04-21 16:01 sungang 阅读(422) 评论(0) 推荐(0) 编辑