Compare commits

...

6 Commits
master ... 1.0

Author SHA1 Message Date
git f1f9732a27 fix #29
9 years ago
git 03278cb454 update Vue 2.x link
9 years ago
git e9eb18d590 add Vue v2.0.0
9 years ago
git 9f28b9c901 fix #10 title to interpolate html
9 years ago
LianYue 8b11eb56f2 Merge pull request #10 from alexeyMohnatkin/fix-title
9 years ago
dizzy fb9e5b4b97 fix title to interpolate html
9 years ago

@ -10,6 +10,15 @@
``` bash ``` bash
npm install vue-upload-component --save npm install vue-upload-component --save
``` ```
### Vue 2.x
https://github.com/lian-yue/vue-upload-component/tree/2.0
``` bash
npm install vue-upload-component@next --save
```
### CommonJS ### CommonJS
```js ```js
var FileUpload = require('vue-upload-component'); var FileUpload = require('vue-upload-component');

479
dist/example.js vendored

@ -514,6 +514,7 @@
// Thrash, waste and sodomy: IE GC bug // Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__(28)('iframe') var iframe = __webpack_require__(28)('iframe')
, i = enumBugKeys.length , i = enumBugKeys.length
, lt = '<'
, gt = '>' , gt = '>'
, iframeDocument; , iframeDocument;
iframe.style.display = 'none'; iframe.style.display = 'none';
@ -523,7 +524,7 @@
// html.removeChild(iframe); // html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document; iframeDocument = iframe.contentWindow.document;
iframeDocument.open(); iframeDocument.open();
iframeDocument.write('<script>document.F=Object</script' + gt); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close(); iframeDocument.close();
createDict = iframeDocument.F; createDict = iframeDocument.F;
while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
@ -542,6 +543,7 @@
return Properties === undefined ? result : dPs(result, Properties); return Properties === undefined ? result : dPs(result, Properties);
}; };
/***/ }, /***/ },
/* 33 */ /* 33 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
@ -592,8 +594,8 @@
/* 37 */ /* 37 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/*! /*!
* Vue.js v1.0.26 * Vue.js v1.0.28
* (c) 2016 Evan You * (c) 2016 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -749,7 +751,7 @@
} }
/** /**
* Camelize a hyphen-delmited string. * Camelize a hyphen-delimited string.
* *
* @param {String} str * @param {String} str
* @return {String} * @return {String}
@ -772,10 +774,10 @@
* @return {String} * @return {String}
*/ */
var hyphenateRE = /([a-z\d])([A-Z])/g; var hyphenateRE = /([^-])([A-Z])/g;
function hyphenate(str) { function hyphenate(str) {
return str.replace(hyphenateRE, '$1-$2').toLowerCase(); return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();
} }
/** /**
@ -995,12 +997,7 @@
var isIE = UA && UA.indexOf('trident') > 0; var isIE = UA && UA.indexOf('trident') > 0;
var isIE9 = UA && UA.indexOf('msie 9.0') > 0; var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
var isAndroid = UA && UA.indexOf('android') > 0; var isAndroid = UA && UA.indexOf('android') > 0;
var isIos = UA && /(iphone|ipad|ipod|ios)/i.test(UA); var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
var iosVersionMatch = isIos && UA.match(/os ([\d_]+)/);
var iosVersion = iosVersionMatch && iosVersionMatch[1].split('_');
// detecting iOS UIWebView by indexedDB
var hasMutationObserverBug = iosVersion && Number(iosVersion[0]) >= 9 && Number(iosVersion[1]) >= 3 && !window.indexedDB;
var transitionProp = undefined; var transitionProp = undefined;
var transitionEndEvent = undefined; var transitionEndEvent = undefined;
@ -1017,6 +1014,12 @@
animationEndEvent = isWebkitAnim ? 'webkitAnimationEnd' : 'animationend'; animationEndEvent = isWebkitAnim ? 'webkitAnimationEnd' : 'animationend';
} }
/* istanbul ignore next */
function isNative(Ctor) {
return (/native code/.test(Ctor.toString())
);
}
/** /**
* Defer a task to execute it asynchronously. Ideally this * Defer a task to execute it asynchronously. Ideally this
* should be executed as a microtask, so we leverage * should be executed as a microtask, so we leverage
@ -1030,35 +1033,55 @@
var nextTick = (function () { var nextTick = (function () {
var callbacks = []; var callbacks = [];
var pending = false; var pending = false;
var timerFunc; var timerFunc = undefined;
function nextTickHandler() { function nextTickHandler() {
pending = false; pending = false;
var copies = callbacks.slice(0); var copies = callbacks.slice(0);
callbacks = []; callbacks.length = 0;
for (var i = 0; i < copies.length; i++) { for (var i = 0; i < copies.length; i++) {
copies[i](); copies[i]();
} }
} }
// the nextTick behavior leverages the microtask queue, which can be accessed
// via either native Promise.then or MutationObserver.
// MutationObserver has wider support, however it is seriously bugged in
// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
// completely stops working after triggering a few times... so, if native
// Promise is available, we will use it:
/* istanbul ignore if */ /* istanbul ignore if */
if (typeof MutationObserver !== 'undefined' && !hasMutationObserverBug) { if (typeof Promise !== 'undefined' && isNative(Promise)) {
var p = Promise.resolve();
var noop = function noop() {};
timerFunc = function () {
p.then(nextTickHandler);
// in problematic UIWebViews, Promise.then doesn't completely break, but
// it can get stuck in a weird state where callbacks are pushed into the
// microtask queue but the queue isn't being flushed, until the browser
// needs to do some other work, e.g. handle a timer. Therefore we can
// "force" the microtask queue to be flushed by adding an empty timer.
if (isIOS) setTimeout(noop);
};
} else if (typeof MutationObserver !== 'undefined') {
// use MutationObserver where native Promise is not available,
// e.g. IE11, iOS7, Android 4.4
var counter = 1; var counter = 1;
var observer = new MutationObserver(nextTickHandler); var observer = new MutationObserver(nextTickHandler);
var textNode = document.createTextNode(counter); var textNode = document.createTextNode(String(counter));
observer.observe(textNode, { observer.observe(textNode, {
characterData: true characterData: true
}); });
timerFunc = function () { timerFunc = function () {
counter = (counter + 1) % 2; counter = (counter + 1) % 2;
textNode.data = counter; textNode.data = String(counter);
}; };
} else { } else {
// webpack attempts to inject a shim for setImmediate // fallback to setTimeout
// if it is used as a global, so we have to work around that to /* istanbul ignore next */
// avoid bundling unnecessary code. timerFunc = setTimeout;
var context = inBrowser ? window : typeof global !== 'undefined' ? global : {};
timerFunc = context.setImmediate || setTimeout;
} }
return function (cb, ctx) { return function (cb, ctx) {
var func = ctx ? function () { var func = ctx ? function () {
cb.call(ctx); cb.call(ctx);
@ -1072,7 +1095,7 @@
var _Set = undefined; var _Set = undefined;
/* istanbul ignore if */ /* istanbul ignore if */
if (typeof Set !== 'undefined' && Set.toString().match(/native code/)) { if (typeof Set !== 'undefined' && isNative(Set)) {
// use native Set when available. // use native Set when available.
_Set = Set; _Set = Set;
} else { } else {
@ -1193,7 +1216,6 @@
}; };
var cache$1 = new Cache(1000); var cache$1 = new Cache(1000);
var filterTokenRE = /[^\s'"]+|'[^']*'|"[^"]*"/g;
var reservedArgRE = /^in$|^-?\d+/; var reservedArgRE = /^in$|^-?\d+/;
/** /**
@ -1202,35 +1224,167 @@
var str; var str;
var dir; var dir;
var c; var len;
var prev; var index;
var i; var chr;
var l; var state;
var lastFilterIndex; var startState = 0;
var inSingle; var filterState = 1;
var inDouble; var filterNameState = 2;
var curly; var filterArgState = 3;
var square;
var paren; var doubleChr = 0x22;
/** var singleChr = 0x27;
* Push a filter to the current directive object var pipeChr = 0x7C;
*/ var escapeChr = 0x5C;
var spaceChr = 0x20;
function pushFilter() {
var exp = str.slice(lastFilterIndex, i).trim(); var expStartChr = { 0x5B: 1, 0x7B: 1, 0x28: 1 };
var filter; var expChrPair = { 0x5B: 0x5D, 0x7B: 0x7D, 0x28: 0x29 };
if (exp) {
filter = {}; function peek() {
var tokens = exp.match(filterTokenRE); return str.charCodeAt(index + 1);
filter.name = tokens[0]; }
if (tokens.length > 1) {
filter.args = tokens.slice(1).map(processFilterArg); function next() {
return str.charCodeAt(++index);
}
function eof() {
return index >= len;
}
function eatSpace() {
while (peek() === spaceChr) {
next();
}
}
function isStringStart(chr) {
return chr === doubleChr || chr === singleChr;
}
function isExpStart(chr) {
return expStartChr[chr];
}
function isExpEnd(start, chr) {
return expChrPair[start] === chr;
}
function parseString() {
var stringQuote = next();
var chr;
while (!eof()) {
chr = next();
// escape char
if (chr === escapeChr) {
next();
} else if (chr === stringQuote) {
break;
}
}
}
function parseSpecialExp(chr) {
var inExp = 0;
var startChr = chr;
while (!eof()) {
chr = peek();
if (isStringStart(chr)) {
parseString();
continue;
}
if (startChr === chr) {
inExp++;
}
if (isExpEnd(startChr, chr)) {
inExp--;
}
next();
if (inExp === 0) {
break;
}
}
}
/**
* syntax:
* expression | filterName [arg arg [| filterName arg arg]]
*/
function parseExpression() {
var start = index;
while (!eof()) {
chr = peek();
if (isStringStart(chr)) {
parseString();
} else if (isExpStart(chr)) {
parseSpecialExp(chr);
} else if (chr === pipeChr) {
next();
chr = peek();
if (chr === pipeChr) {
next();
} else {
if (state === startState || state === filterArgState) {
state = filterState;
}
break;
}
} else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {
eatSpace();
break;
} else {
if (state === filterState) {
state = filterNameState;
}
next();
}
}
return str.slice(start + 1, index) || null;
}
function parseFilterList() {
var filters = [];
while (!eof()) {
filters.push(parseFilter());
}
return filters;
}
function parseFilter() {
var filter = {};
var args;
state = filterState;
filter.name = parseExpression().trim();
state = filterArgState;
args = parseFilterArguments();
if (args.length) {
filter.args = args;
} }
return filter;
} }
if (filter) {
(dir.filters = dir.filters || []).push(filter); function parseFilterArguments() {
var args = [];
while (!eof() && state !== filterState) {
var arg = parseExpression();
if (!arg) {
break;
} }
lastFilterIndex = i + 1; args.push(processFilterArg(arg));
}
return args;
} }
/** /**
@ -1282,56 +1436,22 @@
// reset parser state // reset parser state
str = s; str = s;
inSingle = inDouble = false;
curly = square = paren = 0;
lastFilterIndex = 0;
dir = {}; dir = {};
len = str.length;
index = -1;
chr = '';
state = startState;
for (i = 0, l = str.length; i < l; i++) { var filters;
prev = c;
c = str.charCodeAt(i); if (str.indexOf('|') < 0) {
if (inSingle) { dir.expression = str.trim();
// check single quote } else {
if (c === 0x27 && prev !== 0x5C) inSingle = !inSingle; dir.expression = parseExpression().trim();
} else if (inDouble) { filters = parseFilterList();
// check double quote if (filters.length) {
if (c === 0x22 && prev !== 0x5C) inDouble = !inDouble; dir.filters = filters;
} else if (c === 0x7C && // pipe }
str.charCodeAt(i + 1) !== 0x7C && str.charCodeAt(i - 1) !== 0x7C) {
if (dir.expression == null) {
// first filter, end of expression
lastFilterIndex = i + 1;
dir.expression = str.slice(0, i).trim();
} else {
// already has filter
pushFilter();
}
} else {
switch (c) {
case 0x22:
inDouble = true;break; // "
case 0x27:
inSingle = true;break; // '
case 0x28:
paren++;break; // (
case 0x29:
paren--;break; // )
case 0x5B:
square++;break; // [
case 0x5D:
square--;break; // ]
case 0x7B:
curly++;break; // {
case 0x7D:
curly--;break; // }
}
}
}
if (dir.expression == null) {
dir.expression = str.slice(0, i).trim();
} else if (lastFilterIndex !== 0) {
pushFilter();
} }
cache$1.put(s, dir); cache$1.put(s, dir);
@ -2920,10 +3040,7 @@
isIE: isIE, isIE: isIE,
isIE9: isIE9, isIE9: isIE9,
isAndroid: isAndroid, isAndroid: isAndroid,
isIos: isIos, isIOS: isIOS,
iosVersionMatch: iosVersionMatch,
iosVersion: iosVersion,
hasMutationObserverBug: hasMutationObserverBug,
get transitionProp () { return transitionProp; }, get transitionProp () { return transitionProp; },
get transitionEndEvent () { return transitionEndEvent; }, get transitionEndEvent () { return transitionEndEvent; },
get animationProp () { return animationProp; }, get animationProp () { return animationProp; },
@ -3023,7 +3140,7 @@
// fragment: // fragment:
// if this instance is compiled inside a Fragment, it // if this instance is compiled inside a Fragment, it
// needs to reigster itself as a child of that fragment // needs to register itself as a child of that fragment
// for attach/detach to work properly. // for attach/detach to work properly.
this._frag = options._frag; this._frag = options._frag;
if (this._frag) { if (this._frag) {
@ -3328,7 +3445,7 @@
*/ */
function getPath(obj, path) { function getPath(obj, path) {
return parseExpression(path).get(obj); return parseExpression$1(path).get(obj);
} }
/** /**
@ -3363,7 +3480,7 @@
last = obj; last = obj;
key = path[i]; key = path[i];
if (key.charAt(0) === '*') { if (key.charAt(0) === '*') {
key = parseExpression(key.slice(1)).get.call(original, original); key = parseExpression$1(key.slice(1)).get.call(original, original);
} }
if (i < l - 1) { if (i < l - 1) {
obj = obj[key]; obj = obj[key];
@ -3407,7 +3524,7 @@
var wsRE = /\s/g; var wsRE = /\s/g;
var newlineRE = /\n/g; var newlineRE = /\n/g;
var saveRE = /[\{,]\s*[\w\$_]+\s*:|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`)|new |typeof |void /g; var saveRE = /[\{,]\s*[\w\$_]+\s*:|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\"']|\\.)*`|`(?:[^`\\]|\\.)*`)|new |typeof |void /g;
var restoreRE = /"(\d+)"/g; var restoreRE = /"(\d+)"/g;
var pathTestRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/; var pathTestRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/;
var identRE = /[^\w$\.](?:[A-Za-z_$][\w$]*)/g; var identRE = /[^\w$\.](?:[A-Za-z_$][\w$]*)/g;
@ -3554,7 +3671,7 @@
* @return {Function} * @return {Function}
*/ */
function parseExpression(exp, needSet) { function parseExpression$1(exp, needSet) {
exp = exp.trim(); exp = exp.trim();
// try cache // try cache
var hit = expressionCache.get(exp); var hit = expressionCache.get(exp);
@ -3593,7 +3710,7 @@
} }
var expression = Object.freeze({ var expression = Object.freeze({
parseExpression: parseExpression, parseExpression: parseExpression$1,
isSimplePath: isSimplePath isSimplePath: isSimplePath
}); });
@ -3745,7 +3862,7 @@
this.getter = expOrFn; this.getter = expOrFn;
this.setter = undefined; this.setter = undefined;
} else { } else {
var res = parseExpression(expOrFn, this.twoWay); var res = parseExpression$1(expOrFn, this.twoWay);
this.getter = res.get; this.getter = res.get;
this.setter = res.set; this.setter = res.set;
} }
@ -4589,6 +4706,10 @@
params: ['track-by', 'stagger', 'enter-stagger', 'leave-stagger'], params: ['track-by', 'stagger', 'enter-stagger', 'leave-stagger'],
bind: function bind() { bind: function bind() {
if (false) {
warn('<' + this.el.tagName.toLowerCase() + ' v-for="' + this.expression + '" v-if="' + this.el.getAttribute('v-if') + '">: ' + 'Using v-if and v-for on the same element is not recommended - ' + 'consider filtering the source Array instead.', this.vm);
}
// support "item in/of items" syntax // support "item in/of items" syntax
var inMatch = this.expression.match(/(.*) (?:in|of) (.*)/); var inMatch = this.expression.match(/(.*) (?:in|of) (.*)/);
if (inMatch) { if (inMatch) {
@ -4699,7 +4820,7 @@
}); });
} }
} else { } else {
// new isntance // new instance
frag = this.create(value, alias, i, key); frag = this.create(value, alias, i, key);
frag.fresh = !init; frag.fresh = !init;
} }
@ -5133,24 +5254,6 @@
return frag; return frag;
} }
/**
* Find a vm from a fragment.
*
* @param {Fragment} frag
* @return {Vue|undefined}
*/
function findVmFromFrag(frag) {
var node = frag.node;
// handle multi-node frag
if (frag.end) {
while (!node.__vue__ && node !== frag.end && node.nextSibling) {
node = node.nextSibling;
}
}
return node.__vue__;
}
/** /**
* Create a range array from given number. * Create a range array from given number.
* *
@ -5186,6 +5289,24 @@
}; };
} }
/**
* Find a vm from a fragment.
*
* @param {Fragment} frag
* @return {Vue|undefined}
*/
function findVmFromFrag(frag) {
var node = frag.node;
// handle multi-node frag
if (frag.end) {
while (!node.__vue__ && node !== frag.end && node.nextSibling) {
node = node.nextSibling;
}
}
return node.__vue__;
}
var vIf = { var vIf = {
priority: IF, priority: IF,
@ -5583,15 +5704,16 @@
} }
this.listener = function () { this.listener = function () {
var model = self._watcher.value; var model = self._watcher.get();
if (isArray(model)) { if (isArray(model)) {
var val = self.getValue(); var val = self.getValue();
var i = indexOf(model, val);
if (el.checked) { if (el.checked) {
if (indexOf(model, val) < 0) { if (i < 0) {
model.push(val); self.set(model.concat(val));
} }
} else { } else if (i > -1) {
model.$remove(val); self.set(model.slice(0, i).concat(model.slice(i + 1)));
} }
} else { } else {
self.set(getBooleanValue()); self.set(getBooleanValue());
@ -6108,6 +6230,12 @@
} }
}; };
// logic control
// two-way binding
// event handling
// attributes
// ref & el
// cloak
// must export plain object // must export plain object
var directives = { var directives = {
text: text$1, text: text$1,
@ -6599,6 +6727,7 @@
function compileProps(el, propOptions, vm) { function compileProps(el, propOptions, vm) {
var props = []; var props = [];
var propsData = vm.$options.propsData;
var names = Object.keys(propOptions); var names = Object.keys(propOptions);
var i = names.length; var i = names.length;
var options, name, attr, value, path, parsed, prop; var options, name, attr, value, path, parsed, prop;
@ -6666,13 +6795,16 @@
} else if ((value = getAttr(el, attr)) !== null) { } else if ((value = getAttr(el, attr)) !== null) {
// has literal binding! // has literal binding!
prop.raw = value; prop.raw = value;
} else if (propsData && (value = propsData[name] || propsData[path]) !== null) {
// has propsData
prop.raw = value;
} else if (false) { } else if (false) {
// check possible camelCase prop usage // check possible camelCase prop usage
var lowerCaseName = path.toLowerCase(); var lowerCaseName = path.toLowerCase();
value = /[A-Z\-]/.test(name) && (el.getAttribute(lowerCaseName) || el.getAttribute(':' + lowerCaseName) || el.getAttribute('v-bind:' + lowerCaseName) || el.getAttribute(':' + lowerCaseName + '.once') || el.getAttribute('v-bind:' + lowerCaseName + '.once') || el.getAttribute(':' + lowerCaseName + '.sync') || el.getAttribute('v-bind:' + lowerCaseName + '.sync')); value = /[A-Z\-]/.test(name) && (el.getAttribute(lowerCaseName) || el.getAttribute(':' + lowerCaseName) || el.getAttribute('v-bind:' + lowerCaseName) || el.getAttribute(':' + lowerCaseName + '.once') || el.getAttribute('v-bind:' + lowerCaseName + '.once') || el.getAttribute(':' + lowerCaseName + '.sync') || el.getAttribute('v-bind:' + lowerCaseName + '.sync'));
if (value) { if (value) {
warn('Possible usage error for prop `' + lowerCaseName + '` - ' + 'did you mean `' + attr + '`? HTML is case-insensitive, remember to use ' + 'kebab-case for props in templates.', vm); warn('Possible usage error for prop `' + lowerCaseName + '` - ' + 'did you mean `' + attr + '`? HTML is case-insensitive, remember to use ' + 'kebab-case for props in templates.', vm);
} else if (options.required) { } else if (options.required && (!propsData || !(name in propsData) && !(path in propsData))) {
// warn missing required // warn missing required
warn('Missing required prop: ' + name, vm); warn('Missing required prop: ' + name, vm);
} }
@ -7517,7 +7649,7 @@
var originalDirCount = vm._directives.length; var originalDirCount = vm._directives.length;
linker(); linker();
var dirs = vm._directives.slice(originalDirCount); var dirs = vm._directives.slice(originalDirCount);
dirs.sort(directiveComparator); sortDirectives(dirs);
for (var i = 0, l = dirs.length; i < l; i++) { for (var i = 0, l = dirs.length; i < l; i++) {
dirs[i]._bind(); dirs[i]._bind();
} }
@ -7525,16 +7657,37 @@
} }
/** /**
* Directive priority sort comparator * sort directives by priority (stable sort)
* *
* @param {Object} a * @param {Array} dirs
* @param {Object} b
*/ */
function sortDirectives(dirs) {
if (dirs.length === 0) return;
var groupedMap = {};
var i, j, k, l;
var index = 0;
var priorities = [];
for (i = 0, j = dirs.length; i < j; i++) {
var dir = dirs[i];
var priority = dir.descriptor.def.priority || DEFAULT_PRIORITY;
var array = groupedMap[priority];
if (!array) {
array = groupedMap[priority] = [];
priorities.push(priority);
}
array.push(dir);
}
function directiveComparator(a, b) { priorities.sort(function (a, b) {
a = a.descriptor.def.priority || DEFAULT_PRIORITY;
b = b.descriptor.def.priority || DEFAULT_PRIORITY;
return a > b ? -1 : a === b ? 0 : 1; return a > b ? -1 : a === b ? 0 : 1;
});
for (i = 0, j = priorities.length; i < j; i++) {
var group = groupedMap[priorities[i]];
for (k = 0, l = group.length; k < l; k++) {
dirs[index++] = group[k];
}
}
} }
/** /**
@ -7652,7 +7805,13 @@
}); });
if (names.length) { if (names.length) {
var plural = names.length > 1; var plural = names.length > 1;
warn('Attribute' + (plural ? 's ' : ' ') + names.join(', ') + (plural ? ' are' : ' is') + ' ignored on component ' + '<' + options.el.tagName.toLowerCase() + '> because ' + 'the component is a fragment instance: ' + 'http://vuejs.org/guide/components.html#Fragment-Instance');
var componentName = options.el.tagName.toLowerCase();
if (componentName === 'component' && options.name) {
componentName += ':' + options.name;
}
warn('Attribute' + (plural ? 's ' : ' ') + names.join(', ') + (plural ? ' are' : ' is') + ' ignored on component ' + '<' + componentName + '> because ' + 'the component is a fragment instance: ' + 'http://vuejs.org/guide/components.html#Fragment-Instance');
} }
} }
@ -7711,6 +7870,10 @@
// textarea treats its text content as the initial value. // textarea treats its text content as the initial value.
// just bind it as an attr directive for value. // just bind it as an attr directive for value.
if (el.tagName === 'TEXTAREA') { if (el.tagName === 'TEXTAREA') {
// a textarea which has v-pre attr should skip complie.
if (getAttr(el, 'v-pre') !== null) {
return skip;
}
var tokens = parseText(el.value); var tokens = parseText(el.value);
if (tokens) { if (tokens) {
el.setAttribute(':value', tokensToExp(tokens)); el.setAttribute(':value', tokensToExp(tokens));
@ -8037,7 +8200,7 @@
modifiers: modifiers, modifiers: modifiers,
def: def def: def
}; };
// check ref for v-for and router-view // check ref for v-for, v-if and router-view
if (dirName === 'for' || dirName === 'router-view') { if (dirName === 'for' || dirName === 'router-view') {
descriptor.ref = findRef(el); descriptor.ref = findRef(el);
} }
@ -8277,6 +8440,9 @@
var frag = parseTemplate(template, true); var frag = parseTemplate(template, true);
if (frag) { if (frag) {
var replacer = frag.firstChild; var replacer = frag.firstChild;
if (!replacer) {
return frag;
}
var tag = replacer.tagName && replacer.tagName.toLowerCase(); var tag = replacer.tagName && replacer.tagName.toLowerCase();
if (options.replace) { if (options.replace) {
/* istanbul ignore if */ /* istanbul ignore if */
@ -9029,7 +9195,7 @@
Directive.prototype._checkStatement = function () { Directive.prototype._checkStatement = function () {
var expression = this.expression; var expression = this.expression;
if (expression && this.acceptStatement && !isSimplePath(expression)) { if (expression && this.acceptStatement && !isSimplePath(expression)) {
var fn = parseExpression(expression).get; var fn = parseExpression$1(expression).get;
var scope = this._scope || this.vm; var scope = this._scope || this.vm;
var handler = function handler(e) { var handler = function handler(e) {
scope.$event = e; scope.$event = e;
@ -9477,7 +9643,7 @@
*/ */
Vue.prototype.$get = function (exp, asStatement) { Vue.prototype.$get = function (exp, asStatement) {
var res = parseExpression(exp); var res = parseExpression$1(exp);
if (res) { if (res) {
if (asStatement) { if (asStatement) {
var self = this; var self = this;
@ -9505,7 +9671,7 @@
*/ */
Vue.prototype.$set = function (exp, val) { Vue.prototype.$set = function (exp, val) {
var res = parseExpression(exp, true); var res = parseExpression$1(exp, true);
if (res && res.set) { if (res && res.set) {
res.set.call(this, this, val); res.set.call(this, this, val);
} }
@ -10268,7 +10434,7 @@
} }
/** /**
* Filter filter for arrays * Order filter for arrays
* *
* @param {String|Array<String>|Function} ...sortKeys * @param {String|Array<String>|Function} ...sortKeys
* @param {Number} [order] * @param {Number} [order]
@ -10651,7 +10817,7 @@
installGlobalAPI(Vue); installGlobalAPI(Vue);
Vue.version = '1.0.26'; Vue.version = '1.0.28';
// devtools global hook // devtools global hook
/* istanbul ignore next */ /* istanbul ignore next */
@ -10666,7 +10832,6 @@
}, 0); }, 0);
module.exports = Vue; module.exports = Vue;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ }, /***/ },
/* 38 */ /* 38 */
@ -11188,7 +11353,6 @@
xhr.timeout = this.timeout; xhr.timeout = this.timeout;
} }
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
for (var key in this.request.headers) { for (var key in this.request.headers) {
xhr.setRequestHeader(key, this.request.headers[key]); xhr.setRequestHeader(key, this.request.headers[key]);
} }
@ -11415,14 +11579,14 @@
var _symbol2 = _interopRequireDefault(_symbol); var _symbol2 = _interopRequireDefault(_symbol);
var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default ? "symbol" : typeof obj; }; var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
return typeof obj === "undefined" ? "undefined" : _typeof(obj); return typeof obj === "undefined" ? "undefined" : _typeof(obj);
} : function (obj) { } : function (obj) {
return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
}; };
/***/ }, /***/ },
@ -12202,13 +12366,14 @@
/* 74 */ /* 74 */
/***/ function(module, exports) { /***/ function(module, exports) {
module.exports = "\n<label :class=\"{'file-uploads': true, 'file-uploads-html5': $mode == 'html5', 'file-uploads-html4': $mode == 'html4'}\">\n <span>{{title}}</span>\n <input-file></input-file>\n</label>\n"; module.exports = "\n<label :class=\"{'file-uploads': true, 'file-uploads-html5': $mode == 'html5', 'file-uploads-html4': $mode == 'html4'}\">\n <span>{{{title}}}</span>\n <input-file></input-file>\n</label>\n";
/***/ }, /***/ },
/* 75 */ /* 75 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
var __vue_script__, __vue_template__ var __vue_script__, __vue_template__
var __vue_styles__ = {}
__webpack_require__(77) __webpack_require__(77)
__vue_script__ = __webpack_require__(39) __vue_script__ = __webpack_require__(39)
if (__vue_script__ && if (__vue_script__ &&
@ -12218,9 +12383,15 @@
__vue_template__ = __webpack_require__(74) __vue_template__ = __webpack_require__(74)
module.exports = __vue_script__ || {} module.exports = __vue_script__ || {}
if (module.exports.__esModule) module.exports = module.exports.default if (module.exports.__esModule) module.exports = module.exports.default
var __vue_options__ = typeof module.exports === "function" ? (module.exports.options || (module.exports.options = {})) : module.exports
if (__vue_template__) { if (__vue_template__) {
(typeof module.exports === "function" ? (module.exports.options || (module.exports.options = {})) : module.exports).template = __vue_template__ __vue_options__.template = __vue_template__
} }
if (!__vue_options__.computed) __vue_options__.computed = {}
Object.keys(__vue_styles__).forEach(function (key) {
var module = __vue_styles__[key]
__vue_options__.computed[key] = function () { return module }
})
/***/ }, /***/ },

File diff suppressed because one or more lines are too long

@ -524,6 +524,7 @@ return /******/ (function(modules) { // webpackBootstrap
// Thrash, waste and sodomy: IE GC bug // Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__(28)('iframe') var iframe = __webpack_require__(28)('iframe')
, i = enumBugKeys.length , i = enumBugKeys.length
, lt = '<'
, gt = '>' , gt = '>'
, iframeDocument; , iframeDocument;
iframe.style.display = 'none'; iframe.style.display = 'none';
@ -533,7 +534,7 @@ return /******/ (function(modules) { // webpackBootstrap
// html.removeChild(iframe); // html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document; iframeDocument = iframe.contentWindow.document;
iframeDocument.open(); iframeDocument.open();
iframeDocument.write('<script>document.F=Object</script' + gt); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close(); iframeDocument.close();
createDict = iframeDocument.F; createDict = iframeDocument.F;
while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
@ -552,6 +553,7 @@ return /******/ (function(modules) { // webpackBootstrap
return Properties === undefined ? result : dPs(result, Properties); return Properties === undefined ? result : dPs(result, Properties);
}; };
/***/ }, /***/ },
/* 33 */ /* 33 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
@ -1030,7 +1032,6 @@ return /******/ (function(modules) { // webpackBootstrap
xhr.timeout = this.timeout; xhr.timeout = this.timeout;
} }
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
for (var key in this.request.headers) { for (var key in this.request.headers) {
xhr.setRequestHeader(key, this.request.headers[key]); xhr.setRequestHeader(key, this.request.headers[key]);
} }
@ -1257,14 +1258,14 @@ return /******/ (function(modules) { // webpackBootstrap
var _symbol2 = _interopRequireDefault(_symbol); var _symbol2 = _interopRequireDefault(_symbol);
var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default ? "symbol" : typeof obj; }; var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
return typeof obj === "undefined" ? "undefined" : _typeof(obj); return typeof obj === "undefined" ? "undefined" : _typeof(obj);
} : function (obj) { } : function (obj) {
return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
}; };
/***/ }, /***/ },
@ -2044,13 +2045,14 @@ return /******/ (function(modules) { // webpackBootstrap
/* 72 */ /* 72 */
/***/ function(module, exports) { /***/ function(module, exports) {
module.exports = "\n<label :class=\"{'file-uploads': true, 'file-uploads-html5': $mode == 'html5', 'file-uploads-html4': $mode == 'html4'}\">\n <span>{{title}}</span>\n <input-file></input-file>\n</label>\n"; module.exports = "\n<label :class=\"{'file-uploads': true, 'file-uploads-html5': $mode == 'html5', 'file-uploads-html4': $mode == 'html4'}\">\n <span>{{{title}}}</span>\n <input-file></input-file>\n</label>\n";
/***/ }, /***/ },
/* 73 */ /* 73 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
var __vue_script__, __vue_template__ var __vue_script__, __vue_template__
var __vue_styles__ = {}
__webpack_require__(75) __webpack_require__(75)
__vue_script__ = __webpack_require__(37) __vue_script__ = __webpack_require__(37)
if (__vue_script__ && if (__vue_script__ &&
@ -2060,9 +2062,15 @@ return /******/ (function(modules) { // webpackBootstrap
__vue_template__ = __webpack_require__(72) __vue_template__ = __webpack_require__(72)
module.exports = __vue_script__ || {} module.exports = __vue_script__ || {}
if (module.exports.__esModule) module.exports = module.exports.default if (module.exports.__esModule) module.exports = module.exports.default
var __vue_options__ = typeof module.exports === "function" ? (module.exports.options || (module.exports.options = {})) : module.exports
if (__vue_template__) { if (__vue_template__) {
(typeof module.exports === "function" ? (module.exports.options || (module.exports.options = {})) : module.exports).template = __vue_template__ __vue_options__.template = __vue_template__
} }
if (!__vue_options__.computed) __vue_options__.computed = {}
Object.keys(__vue_styles__).forEach(function (key) {
var module = __vue_styles__[key]
__vue_options__.computed[key] = function () { return module }
})
/***/ }, /***/ },

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -70,7 +70,7 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<file-upload title="Add upload files" class="file-upload" name="file" post-action="./post.php" put-action="./put.php" :extensions="extensions" :accept="accept" :multiple="multiple" :size="size" v-ref:upload :drop="drop"></file-upload> <file-upload title="<strong>Add upload files</strong>" class="file-upload" name="file" post-action="./post.php" put-action="./put.php" :extensions="extensions" :accept="accept" :multiple="multiple" :size="size" v-ref:upload :drop="drop"></file-upload>
</td> </td>
<td> <td>
<button v-if="upload.active" type="submit" @click.prevent="$refs.upload.active = !$refs.upload.active">Stop upload</button> <button v-if="upload.active" type="submit" @click.prevent="$refs.upload.active = !$refs.upload.active">Stop upload</button>

@ -1,7 +1,7 @@
{ {
"name": "vue-upload-component", "name": "vue-upload-component",
"description": "Vue.js file upload component, Support for multiple file uploads, progress, html5, html4, support ie9", "description": "Vue.js file upload component, Support for multiple file uploads, progress, html5, html4, support ie9",
"version": "0.3.7", "version": "0.3.9",
"author": "LianYue", "author": "LianYue",
"scripts": { "scripts": {
"dev": "webpack-dev-server --inline --hot", "dev": "webpack-dev-server --inline --hot",

@ -1,6 +1,6 @@
<template> <template>
<label :class="{'file-uploads': true, 'file-uploads-html5': $mode == 'html5', 'file-uploads-html4': $mode == 'html4'}"> <label :class="{'file-uploads': true, 'file-uploads-html5': $mode == 'html5', 'file-uploads-html4': $mode == 'html4'}">
<span>{{title}}</span> <span>{{{title}}}</span>
<input-file></input-file> <input-file></input-file>
</label> </label>
</template> </template>
@ -478,7 +478,7 @@ export default {
xhr.timeout = this.timeout; xhr.timeout = this.timeout;
} }
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); // xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
for (var key in this.request.headers) { for (var key in this.request.headers) {
xhr.setRequestHeader(key, this.request.headers[key]); xhr.setRequestHeader(key, this.request.headers[key]);
} }

Loading…
Cancel
Save