Skip to content

Commit eb11139

Browse files
author
Evan You
committed
Release-v0.7.5
1 parent 66988a5 commit eb11139

File tree

5 files changed

+26
-31
lines changed

5 files changed

+26
-31
lines changed

bower.json

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

component.json

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

dist/vue.js

+21-25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
VueJS v0.7.4
2+
VueJS v0.7.5
33
(c) 2014 Evan You
44
License: MIT
55
*/
@@ -563,6 +563,7 @@ var prefix = 'v',
563563
'text',
564564
'repeat',
565565
'partial',
566+
'with',
566567
'component',
567568
'component-id',
568569
'transition'
@@ -1027,9 +1028,11 @@ CompilerProto.compile = function (node, root) {
10271028

10281029
// special attributes to check
10291030
var repeatExp,
1030-
componentExp,
1031+
withKey,
10311032
partialId,
1032-
directive
1033+
directive,
1034+
componentId = utils.attr(node, 'component') || tagName.toLowerCase(),
1035+
componentCtor = compiler.getOption('components', componentId)
10331036

10341037
// It is important that we access these attributes
10351038
// procedurally because the order matters.
@@ -1045,21 +1048,16 @@ CompilerProto.compile = function (node, root) {
10451048
// repeat block cannot have v-id at the same time.
10461049
directive = Directive.parse('repeat', repeatExp, compiler, node)
10471050
if (directive) {
1051+
directive.Ctor = componentCtor
10481052
compiler.bindDirective(directive)
10491053
}
10501054

1051-
// v-component has 2nd highest priority
1052-
} else if (!root && (componentExp = utils.attr(node, 'component'))) {
1055+
// v-with has 2nd highest priority
1056+
} else if (!root && ((withKey = utils.attr(node, 'with')) || componentCtor)) {
10531057

1054-
directive = Directive.parse('component', componentExp, compiler, node)
1058+
directive = Directive.parse('with', withKey || '', compiler, node)
10551059
if (directive) {
1056-
// component directive is a bit different from the others.
1057-
// when it has no argument, it should be treated as a
1058-
// simple directive with its key as the argument.
1059-
if (componentExp.indexOf(':') === -1) {
1060-
directive.isSimple = true
1061-
directive.arg = directive.key
1062-
}
1060+
directive.Ctor = componentCtor
10631061
compiler.bindDirective(directive)
10641062
}
10651063

@@ -2817,7 +2815,7 @@ module.exports = {
28172815
repeat : require('./repeat'),
28182816
model : require('./model'),
28192817
'if' : require('./if'),
2820-
component : require('./component'),
2818+
'with' : require('./with'),
28212819

28222820
attr: function (value) {
28232821
this.el.setAttribute(this.arg, value)
@@ -3008,9 +3006,8 @@ module.exports = {
30083006
ctn = self.container = el.parentNode
30093007

30103008
// extract child VM information, if any
3011-
ViewModel = ViewModel || require('../viewmodel')
3012-
var componentId = utils.attr(el, 'component')
3013-
self.ChildVM = self.compiler.getOption('components', componentId) || ViewModel
3009+
ViewModel = ViewModel || require('../viewmodel')
3010+
self.Ctor = self.Ctor || ViewModel
30143011

30153012
// extract transition information
30163013
self.hasTrans = el.hasAttribute(config.attrs.transition)
@@ -3087,7 +3084,7 @@ module.exports = {
30873084
}, this.compiler)
30883085
}
30893086

3090-
item = new this.ChildVM({
3087+
item = new this.Ctor({
30913088
el: node,
30923089
data: data,
30933090
compilerOptions: {
@@ -3350,8 +3347,8 @@ module.exports = {
33503347
}
33513348
}
33523349
});
3353-
require.register("vue/src/directives/component.js", function(exports, require, module){
3354-
var utils = require('../utils')
3350+
require.register("vue/src/directives/with.js", function(exports, require, module){
3351+
var ViewModel
33553352

33563353
module.exports = {
33573354

@@ -3370,16 +3367,15 @@ module.exports = {
33703367
},
33713368

33723369
build: function (value) {
3373-
var Ctor = this.compiler.getOption('components', this.arg)
3374-
if (!Ctor) utils.warn('unknown component: ' + this.arg)
3375-
var options = {
3370+
ViewModel = ViewModel || require('../viewmodel')
3371+
var Ctor = this.Ctor || ViewModel
3372+
this.component = new Ctor({
33763373
el: this.el,
33773374
data: value,
33783375
compilerOptions: {
33793376
parentCompiler: this.compiler
33803377
}
3381-
}
3382-
this.component = new Ctor(options)
3378+
})
33833379
},
33843380

33853381
unbind: function () {

dist/vue.min.js

+2-3
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.7.4",
3+
"version": "0.7.5",
44
"author": {
55
"name": "Evan You",
66
"email": "[email protected]",

0 commit comments

Comments
 (0)