diff --git a/.eslintrc.json b/.eslintrc.json index 0258863..e305bd1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -27,6 +27,8 @@ "no-console": 0, "comma-dangle": 0, "no-extra-semi": 0, + "space-before-function-paren": 0, + "no-underscore-dangle": 0, "semi": ["error", "always"] } } diff --git a/.gitignore b/.gitignore index a5cf060..9a0d91c 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,5 @@ project.xcworkspace # node_modules/ npm-debug.log - -.idea \ No newline at end of file +dist +.idea diff --git a/.npmignore b/.npmignore index 1320f90..c34623e 100644 --- a/.npmignore +++ b/.npmignore @@ -1 +1,5 @@ site +.eslintrc.json +shots +.babelrc +webpack.config.js diff --git a/README.md b/README.md index b838a85..04c6881 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,19 @@ new Vue({ } }); ``` +NUXT +``` js +import Vue from 'vue'; +import VueCoreImageUpload from 'vue-core-image-upload/dist/ssr'; + +Vue.use( VueCoreImageUpload ); + +plugins: [ + { src: '~plugins/vue-core-image-upload.js', ssr: false } +] +``` -[Demo](http://vanthink-ued.github.io/vue-core-image-upload/upload.html) +[Demo](http://vanthink-ued.github.io/vue-core-image-upload/index.html) ### Props @@ -117,6 +128,18 @@ new Vue({ + + + + + + + + + + + + @@ -165,5 +188,3 @@ new Vue({ ### Contributions Your contributions and suggestions are welcome 😄😄😄💐💐💐. - - diff --git a/UPDATE.log b/UPDATE.log new file mode 100644 index 0000000..805d9b0 --- /dev/null +++ b/UPDATE.log @@ -0,0 +1,9 @@ +### TODO List + +Fixed 旋转的 bug + +旋转的定位 + +读取头部 exif + +获取正确的定位 diff --git a/demo/demo.min.js b/demo/demo.min.js deleted file mode 100644 index 5103949..0000000 --- a/demo/demo.min.js +++ /dev/null @@ -1,9 +0,0 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),o=r(i),a=n(2);o.default.config.silent=!1,o.default.config.devtools=!1,new o.default({el:"#app",components:{"vue-core-image-upload":a},data:{name:"Jiraiya",src:"http://img1.vued.vanthink.cn/vued0a233185b6027244f9d43e653227439a.png",cropSrc:"http://img1.vued.vanthink.cn/vued7553a09a5d5209ebd00a48264394b7f3.png",cropArgs:{},data:{token:"123123123"}},methods:{imageuploaded:function(e){if(0===e.errcode){if(e.data.src)return void(this.src=e.data.src);this.name=e.data.name,this.cropArgs={toCropImgH:parseInt(e.data.post.toCropImgH),toCropImgW:parseInt(e.data.post.toCropImgW),toCropImgX:parseInt(e.data.post.toCropImgX),toCropImgY:parseInt(e.data.post.toCropImgY)},this.cropSrc="http://img1.vued.vanthink.cn/vued41b900045d6d44f3b32e06049621b415.png"}},imagechanged:function(e){console.log(e)},errorhandle:function(e){console.warn(e)}}})},function(e,t,n){(function(t){/*! - * Vue.js v2.1.8 - * (c) 2014-2016 Evan You - * Released under the MIT License. - */ -!function(t,n){e.exports=n()}(this,function(){"use strict";function e(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function n(e){var t=parseFloat(e,10);return t||0===t?t:e}function r(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}function o(e,t){return pi.call(e,t)}function a(e){return"string"==typeof e||"number"==typeof e}function s(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}function c(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function u(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function l(e,t){for(var n in t)e[n]=t[n];return e}function f(e){return null!==e&&"object"==typeof e}function d(e){return Ai.call(e)===bi}function p(e){for(var t={},n=0;nxi._maxUpdateCount)){Li("You may have an infinite update loop "+(e.user?'in watcher with expression "'+e.expression+'"':"in a component render function."),e.vm);break}}Di&&xi.devtools&&Di.emit("flush"),Y()}function z(e){var t=e.id;if(null==oo[t]){if(oo[t]=!0,co){for(var n=io.length-1;n>=0&&io[n].id>e.id;)n--;io.splice(Math.max(n,uo)+1,0,e)}else io.push(e);so||(so=!0,Ni(G))}}function q(e){ho.clear(),W(e,ho)}function W(e,t){var n,r,i=Array.isArray(e);if((i||f(e))&&Object.isExtensible(e)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)W(e[n],t);else for(r=Object.keys(e),n=r.length;n--;)W(e[r[n]],t)}}function K(e){e._watchers=[];var t=e.$options;t.props&&V(e,t.props),t.methods&&te(e,t.methods),t.data?X(e):S(e._data={},!0),t.computed&&Z(e,t.computed),t.watch&&ne(e,t.watch)}function V(e,t){var n=e.$options.propsData||{},r=e.$options._propKeys=Object.keys(t),i=!e.$parent;Gi.shouldConvert=i;for(var o=function(i){var o=r[i];vo[o]&&Li('"'+o+'" is a reserved attribute and cannot be used as component prop.',e),O(e,o,R(o,t,n,e),function(){e.$parent&&!Gi.isSettingProps&&Li("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: \""+o+'"',e)})},a=0;a1?u(n):n;for(var r=u(arguments,1),i=0,o=n.length;i-1:e.test(t)}function Xe(e){var t={};t.get=function(){return xi},t.set=function(){Li("Do not replace the Vue.config object, set individual fields instead.")},Object.defineProperty(e,"config",t),e.util=Vi,e.set=I,e.delete=E,e.nextTick=Ni,e.options=Object.create(null),xi._assetTypes.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,l(e.options.components,Oo),ze(e),qe(e),We(e),Ke(e)}function Ze(e){for(var t=e.data,n=e,r=e;r.child;)r=r.child._vnode,r.data&&(t=et(r.data,t));for(;n=n.parent;)n.data&&(t=et(t,n.data));return tt(t)}function et(e,t){return{staticClass:nt(e.staticClass,t.staticClass),class:e.class?[e.class,t.class]:t.class}}function tt(e){var t=e.class,n=e.staticClass;return n||t?nt(n,rt(t)):""}function nt(e,t){return e?t?e+" "+t:e:t||""}function rt(e){var t="";if(!e)return t;if("string"==typeof e)return e;if(Array.isArray(e)){for(var n,r=0,i=e.length;r-1?Uo[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Uo[e]=/HTMLUnknownElement/.test(t.toString())}function at(e){if("string"==typeof e){var t=e;if(e=document.querySelector(e),!e)return Li("Cannot find element: "+t),document.createElement("div")}return e}function st(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&"multiple"in t.data.attrs&&n.setAttribute("multiple","multiple"),n)}function ct(e,t){return document.createElementNS(Po[e],t)}function ut(e){return document.createTextNode(e)}function lt(e){return document.createComment(e)}function ft(e,t,n){e.insertBefore(t,n)}function dt(e,t){e.removeChild(t)}function pt(e,t){e.appendChild(t)}function ht(e){return e.parentNode}function vt(e){return e.nextSibling}function gt(e){return e.tagName}function mt(e,t){e.textContent=t}function yt(e,t,n){e.setAttribute(t,n)}function At(e,t){var n=e.data.ref;if(n){var r=e.context,o=e.child||e.elm,a=r.$refs;t?Array.isArray(a[n])?i(a[n],o):a[n]===o&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])&&a[n].indexOf(o)<0?a[n].push(o):a[n]=[o]:a[n]=o}}function bt(e){return null==e}function _t(e){return null!=e}function wt(e,t){return e.key===t.key&&e.tag===t.tag&&e.isComment===t.isComment&&!e.data==!t.data}function xt(e,t,n){var r,i,o={};for(r=t;r<=n;++r)i=e[r].key,_t(i)&&(o[i]=r);return o}function Ct(e){function t(e){return new mo(I.tagName(e).toLowerCase(),{},[],void 0,e)}function n(e,t){function n(){0===--n.listeners&&i(e)}return n.listeners=t,n}function i(e){var t=I.parentNode(e);t&&I.removeChild(t,e)}function o(e,t,n,r,i){if(e.isRootInsert=!i,!s(e,t,n,r)){var o=e.data,a=e.children,c=e.tag;_t(c)?(o&&o.pre&&E++,E||e.ns||xi.ignoredElements.length&&xi.ignoredElements.indexOf(c)>-1||!xi.isUnknownElement(c)||Li("Unknown custom element: <"+c+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',e.context),e.elm=e.ns?I.createElementNS(e.ns,c):I.createElement(c,e),h(e),l(e,a,t),_t(o)&&d(e,t),u(n,e.elm,r),o&&o.pre&&E--):e.isComment?(e.elm=I.createComment(e.text),u(n,e.elm,r)):(e.elm=I.createTextNode(e.text),u(n,e.elm,r))}}function s(e,t,n,r){var i=e.data;if(_t(i)){var o=_t(e.child)&&i.keepAlive;if(_t(i=i.hook)&&_t(i=i.init)&&i(e,!1,n,r),_t(e.child))return p(e,t),o&&c(e,t,n,r),!0}}function c(e,t,n,r){for(var i,o=e;o.child;)if(o=o.child._vnode,_t(i=o.data)&&_t(i=i.transition)){for(i=0;id?(u=bt(n[g+1])?null:n[g+1].elm,v(e,u,n,f,g,r)):f>g&&m(e,t,l,d)}function b(e,t,n,r){if(e!==t){if(t.isStatic&&e.isStatic&&t.key===e.key&&(t.isCloned||t.isOnce))return t.elm=e.elm,void(t.child=e.child);var i,o=t.data,a=_t(o);a&&_t(i=o.hook)&&_t(i=i.prepatch)&&i(e,t);var s=t.elm=e.elm,c=e.children,u=t.children;if(a&&f(t)){for(i=0;i, or missing . Bailing hydration and performing full client-side render.")}e=t(e)}if(c=e.elm,u=I.parentNode(c),o(n,d,u,I.nextSibling(c)),n.parent){for(var h=n.parent;h;)h.elm=n.elm,h=h.parent;if(f(n))for(var v=0;v-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+e.getAttribute("class")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Yt(e,t){if(t&&t.trim())if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t);else{for(var n=" "+e.getAttribute("class")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");e.setAttribute("class",n.trim())}}function Gt(e){va(function(){va(e)})}function zt(e,t){(e._transitionClasses||(e._transitionClasses=[])).push(t),Jt(e,t)}function qt(e,t){e._transitionClasses&&i(e._transitionClasses,t),Yt(e,t)}function Wt(e,t,n){var r=Kt(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ua?da:ha,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=ua,l=a,f=o.length):t===la?u>0&&(n=la,l=u,f=c.length):(l=Math.max(a,u),n=l>0?a>u?ua:la:null,f=n?n===ua?o.length:c.length:0);var d=n===ua&&ga.test(r[fa+"Property"]);return{type:n,timeout:l,propCount:f,hasTransform:d}}function Vt(e,t){for(;e.length1,T=n._enterCb=nn(function(){$&&(qt(n,k),qt(n,C)),T.cancelled?($&&qt(n,x),E&&E(n)):I&&I(n),n._enterCb=null});e.data.show||ue(e.data.hook||(e.data.hook={}),"insert",function(){var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.context===e.context&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),O&&O(n,T)},"transition-insert"),S&&S(n),$&&(zt(n,x),zt(n,C),Gt(function(){zt(n,k),qt(n,x),T.cancelled||M||Wt(n,o,T)})),e.data.show&&(t&&t(),O&&O(n,T)),$||M||T()}}}function en(e,t){function n(){m.cancelled||(e.data.show||((r.parentNode._pending||(r.parentNode._pending={}))[e.key]=e),l&&l(r),v&&(zt(r,s),zt(r,u),Gt(function(){zt(r,c),qt(r,s),m.cancelled||g||Wt(r,a,m)})),f&&f(r,m),v||g||m())}var r=e.elm;r._enterCb&&(r._enterCb.cancelled=!0,r._enterCb());var i=tn(e.data.transition);if(!i)return t();if(!r._leaveCb&&1===r.nodeType){var o=i.css,a=i.type,s=i.leaveClass,c=i.leaveToClass,u=i.leaveActiveClass,l=i.beforeLeave,f=i.leave,d=i.afterLeave,p=i.leaveCancelled,h=i.delayLeave,v=o!==!1&&!Ei,g=f&&(f._length||f.length)>1,m=r._leaveCb=nn(function(){r.parentNode&&r.parentNode._pending&&(r.parentNode._pending[e.key]=null),v&&(qt(r,c),qt(r,u)),m.cancelled?(v&&qt(r,s),p&&p(r)):(t(),d&&d(r)),r._leaveCb=null});h?h(n):n()}}function tn(e){if(e){if("object"==typeof e){var t={};return e.css!==!1&&l(t,ma(e.name||"v")),l(t,e),t}return"string"==typeof e?ma(e):void 0}}function nn(e){var t=!1;return function(){t||(t=!0,e())}}function rn(e,t){t.data.show||Zt(t)}function on(e,t,n){var r=t.value,i=e.multiple;if(i&&!Array.isArray(r))return void Li(':\nv-model does not support dynamic input types. Use v-if branches instead.'),"select"===o?ti(e,r,i):"input"===o&&"checkbox"===a?Xr(e,r,i):"input"===o&&"radio"===a?Zr(e,r,i):ei(e,r,i),!0}function Xr(e,t,n){null!=e.attrsMap.checked&&As("<"+e.tag+' v-model="'+t+"\" checked>:\ninline checked attributes will be ignored when using v-model. Declare initial values in the component's data option instead.");var r=n&&n.number,i=jn(e,"value")||"null",o=jn(e,"true-value")||"true",a=jn(e,"false-value")||"false";En(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Tn(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+t+"=$$a.concat($$v))}else{$$i>-1&&("+t+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+t+"=$$c}",null,!0)}function Zr(e,t,n){null!=e.attrsMap.checked&&As("<"+e.tag+' v-model="'+t+"\" checked>:\ninline checked attributes will be ignored when using v-model. Declare initial values in the component's data option instead.");var r=n&&n.number,i=jn(e,"value")||"null";i=r?"_n("+i+")":i,En(e,"checked","_q("+t+","+i+")"),Tn(e,"change",ri(t,i),null,!0)}function ei(e,t,n){"input"===e.tag&&e.attrsMap.value&&As("<"+e.tag+' v-model="'+t+'" value="'+e.attrsMap.value+"\">:\ninline value attributes will be ignored when using v-model. Declare initial values in the component's data option instead."),"textarea"===e.tag&&e.children.length&&As('
10485760(10M) Limit the size of the file
maxFileSizeNumber10485760(10M)Limit the size of the file
multipleSizeNumber5Limit the count of the file
maxWidth Number