Skip to content

Commit e614d9c

Browse files
committed
[release] 0.12.4
1 parent 25eee91 commit e614d9c

File tree

4 files changed

+55
-56
lines changed

4 files changed

+55
-56
lines changed

component.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue",
3-
"version": "0.12.3",
3+
"version": "0.12.4",
44
"main": "src/vue.js",
55
"author": "Evan You <[email protected]>",
66
"description": "Simple, Fast & Composable MVVM for building interative interfaces",

dist/vue.js

+49-50
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Vue.js v0.12.3
2+
* Vue.js v0.12.4
33
* (c) 2015 Evan You
44
* Released under the MIT License.
55
*/
@@ -375,10 +375,12 @@ return /******/ (function(modules) { // webpackBootstrap
375375
*/
376376

377377
_assetTypes: [
378+
'component',
378379
'directive',
379380
'elementDirective',
380381
'filter',
381-
'transition'
382+
'transition',
383+
'partial'
382384
],
383385

384386
/**
@@ -801,8 +803,27 @@ return /******/ (function(modules) { // webpackBootstrap
801803
/* 6 */
802804
/***/ function(module, exports, __webpack_require__) {
803805

806+
var _ = __webpack_require__(1)
804807
var config = __webpack_require__(3)
805808

809+
/**
810+
* Query an element selector if it's not an element already.
811+
*
812+
* @param {String|Element} el
813+
* @return {Element}
814+
*/
815+
816+
exports.query = function (el) {
817+
if (typeof el === 'string') {
818+
var selector = el
819+
el = document.querySelector(el)
820+
if (!el) {
821+
_.warn('Cannot find element: ' + selector)
822+
}
823+
}
824+
return el
825+
}
826+
806827
/**
807828
* Check if a node is in the document.
808829
* Note: document.documentElement.contains should work here
@@ -1447,7 +1468,9 @@ return /******/ (function(modules) { // webpackBootstrap
14471468
Sub.extend = Super.extend
14481469
// create asset registers, so extended classes
14491470
// can have their private assets too.
1450-
createAssetRegisters(Sub)
1471+
config._assetTypes.forEach(function (type) {
1472+
Sub[type] = Super[type]
1473+
})
14511474
return Sub
14521475
}
14531476

@@ -1486,51 +1509,29 @@ return /******/ (function(modules) { // webpackBootstrap
14861509
}
14871510

14881511
/**
1489-
* Define asset registration methods on a constructor.
1512+
* Create asset registration methods with the following
1513+
* signature:
14901514
*
1491-
* @param {Function} Constructor
1515+
* @param {String} id
1516+
* @param {*} definition
14921517
*/
14931518

1494-
function createAssetRegisters (Constructor) {
1495-
1496-
/* Asset registration methods share the same signature:
1497-
*
1498-
* @param {String} id
1499-
* @param {*} definition
1500-
*/
1501-
1502-
config._assetTypes.forEach(function (type) {
1503-
Constructor[type] = function (id, definition) {
1504-
if (!definition) {
1505-
return this.options[type + 's'][id]
1506-
} else {
1507-
this.options[type + 's'][id] = definition
1508-
}
1509-
}
1510-
})
1511-
1512-
/**
1513-
* Component registration needs to automatically invoke
1514-
* Vue.extend on object values.
1515-
*
1516-
* @param {String} id
1517-
* @param {Object|Function} definition
1518-
*/
1519-
1520-
Constructor.component = function (id, definition) {
1519+
config._assetTypes.forEach(function (type) {
1520+
exports[type] = function (id, definition) {
15211521
if (!definition) {
1522-
return this.options.components[id]
1522+
return this.options[type + 's'][id]
15231523
} else {
1524-
if (_.isPlainObject(definition)) {
1524+
if (
1525+
type === 'component' &&
1526+
_.isPlainObject(definition)
1527+
) {
15251528
definition.name = id
15261529
definition = _.Vue.extend(definition)
15271530
}
1528-
this.options.components[id] = definition
1531+
this.options[type + 's'][id] = definition
15291532
}
15301533
}
1531-
}
1532-
1533-
createAssetRegisters(exports)
1534+
})
15341535

15351536

15361537
/***/ },
@@ -2109,6 +2110,7 @@ return /******/ (function(modules) { // webpackBootstrap
21092110

21102111
function checkElementDirectives (el, options) {
21112112
var tag = el.tagName.toLowerCase()
2113+
if (_.commonTagRE.test(tag)) return
21122114
var def = resolveAsset(options, 'elementDirectives', tag)
21132115
if (def) {
21142116
return makeTerminalNodeLinkFn(el, tag, '', options, def)
@@ -8105,17 +8107,19 @@ return /******/ (function(modules) { // webpackBootstrap
81058107
var options = this.$options
81068108
var el = options.el
81078109
var props = options.props
8108-
this._propsUnlinkFn = el && props
8109-
? compiler.compileAndLinkProps(
8110-
this, el, props
8111-
)
8112-
: null
81138110
if (props && !el) {
81148111
_.warn(
81158112
'Props will not be compiled if no `el` option is ' +
81168113
'provided at instantiation.'
81178114
)
81188115
}
8116+
// make sure to convert string selectors into element now
8117+
el = options.el = _.query(el)
8118+
this._propsUnlinkFn = el && props
8119+
? compiler.compileAndLinkProps(
8120+
this, el, props
8121+
)
8122+
: null
81198123
}
81208124

81218125
/**
@@ -9500,15 +9504,9 @@ return /******/ (function(modules) { // webpackBootstrap
95009504
_.warn('$mount() should be called only once.')
95019505
return
95029506
}
9507+
el = _.query(el)
95039508
if (!el) {
95049509
el = document.createElement('div')
9505-
} else if (typeof el === 'string') {
9506-
var selector = el
9507-
el = document.querySelector(el)
9508-
if (!el) {
9509-
_.warn('Cannot find element: ' + selector)
9510-
return
9511-
}
95129510
}
95139511
this._compile(el)
95149512
this._isCompiled = true
@@ -9556,6 +9554,7 @@ return /******/ (function(modules) { // webpackBootstrap
95569554
return compiler.compile(el, this.$options, true, host)(this, el)
95579555
}
95589556

9557+
95599558
/***/ }
95609559
/******/ ])
95619560
});

dist/vue.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue",
3-
"version": "0.12.3",
3+
"version": "0.12.4",
44
"author": "Evan You <[email protected]>",
55
"license": "MIT",
66
"description": "Simple, Fast & Composable MVVM for building interative interfaces",

0 commit comments

Comments
 (0)