Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
bcc965b
custom elements off by default
yyx990803 Mar 3, 2014
8d65a07
make primitive arrays work with computed property
yyx990803 Mar 3, 2014
1d2c32d
copy attributes when replace:true
yyx990803 Mar 3, 2014
f98eb96
use `nodeValue` instead of `textContent` for textNodes
yyx990803 Mar 3, 2014
482a3ca
remove `customTags` option; custom tags only respected when containin…
Mar 5, 2014
3759313
strip log and warn in production build.
Mar 5, 2014
bedcb22
allow nested path for computed properties that return objects
yyx990803 Mar 6, 2014
ae2965c
eval
yyx990803 Mar 6, 2014
6f4c495
Compiler.prototype.eval
yyx990803 Mar 6, 2014
3ddf84e
rename test titles + compiler.eval test
yyx990803 Mar 6, 2014
d56feb0
enable interpolcation in literal directives except v-component
yyx990803 Mar 6, 2014
83def44
make dynamic resolving built-in for custom literal directives
yyx990803 Mar 6, 2014
f211326
simplify text regex
yyx990803 Mar 6, 2014
2fe832f
conditional components!
yyx990803 Mar 6, 2014
d06892b
component check fix
yyx990803 Mar 6, 2014
835dd0e
fix #161 event propagation control
Mar 7, 2014
cea54de
alias for v-repeat
Mar 7, 2014
656c015
simplify Compiler.eval
yyx990803 Mar 8, 2014
10a0cc1
v-view
yyx990803 Mar 9, 2014
09927a4
unit test for v-view
yyx990803 Mar 9, 2014
9a75612
slightly improve text parser perf (10%)
Mar 10, 2014
25344cf
Object.$add/$delete + renamed Array augmentation methods to prefix wi…
yyx990803 Mar 10, 2014
f1cd944
fix Array linking converting already converted objects, minor fix for…
Mar 10, 2014
e07f25d
change todomvc example to use computed property based implementation
Mar 10, 2014
4ebff99
computed filters first pass
Mar 11, 2014
607e197
computed filters + test
yyx990803 Mar 11, 2014
74590b2
custom filter API + exp parser unit test improvements
yyx990803 Mar 11, 2014
a8d5a35
also check for this[...] in computed filters
Mar 11, 2014
482fdc0
fix utils.warn not stripped in prod build
Mar 11, 2014
66abd23
fix meta property value checking
Mar 11, 2014
876f859
use gulp-component 0.1.6 with modified require header
Mar 11, 2014
e11f5fd
include src for bower
yyx990803 Mar 12, 2014
336d06d
filterBy & orderBy first pass
Mar 11, 2014
a249992
tests for array filters
yyx990803 Mar 12, 2014
5eddfd0
make array filters work with objects
Mar 12, 2014
2ddcae6
fix #172 `parent` option in Vue.extend
Mar 12, 2014
2059be5
bindable paramAttributes
Mar 12, 2014
665520f
v-component & v-with refactor
Mar 12, 2014
25be79c
clean up
Mar 12, 2014
c4897fa
remove duplicate array in compiler
Mar 12, 2014
775948d
refactor compile priority order
Mar 12, 2014
3df6343
v-if refactor + change to use childVM
Mar 13, 2014
f3af959
Collect dependencies on all types
yyx990803 Mar 13, 2014
984304c
allow config custom interpolation delimiters
Mar 13, 2014
5872bf3
fix #176 + node compiling perf improvements
Mar 13, 2014
55d8dbe
fix #176 again...
Mar 13, 2014
398bf7e
fix browserify can't deal with 'if' issue...
Mar 13, 2014
96541d5
add e.targetEl to account for e.currentTarget
Mar 14, 2014
dbe26cd
allow stop propagation if handler fn returns true
dyu Mar 15, 2014
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"sub": true,
"node": true,
"laxbreak": true,
"evil": true,
"eqnull": true,
"globals": {
"console": true
}
Expand Down
1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"ignore": [
".*",
"examples",
"src",
"test",
"tasks",
"Gruntfile.js",
Expand Down
4 changes: 3 additions & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"src/directives/model.js",
"src/directives/with.js",
"src/directives/html.js",
"src/directives/style.js"
"src/directives/style.js",
"src/directives/partial.js",
"src/directives/view.js"
]
}
3 changes: 1 addition & 2 deletions examples/todomvc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ <h1>todos</h1>
<ul id="todo-list">
<li
class="todo"
v-repeat="todos"
v-if="filterTodo(this)"
v-repeat="todos | filterTodos"
v-class="
completed : completed,
editing : this == editedTodo
Expand Down
54 changes: 23 additions & 31 deletions examples/todomvc/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@

'use strict';

var filters = {
all: function (todo) {
return true;
},
active: function (todo) {
return !todo.completed;
},
completed: function (todo) {
return todo.completed;
}
};

exports.app = new Vue({

// the root element that will be compiled
Expand All @@ -13,7 +25,8 @@
data: {
todos: todoStorage.fetch(),
newTodo: '',
editedTodo: null
editedTodo: null,
filter: 'all'
},

// a custom directive to wait for the DOM to be updated
Expand All @@ -31,35 +44,17 @@
}
},

// the `created` lifecycle hook.
// this is where we do the initialization work.
// http://vuejs.org/api/instantiation-options.html#created
created: function () {
// setup filters
this.filters = {
all: function (todo) {
// collect dependency.
// http://vuejs.org/guide/computed.html#Dependency_Collection_Gotcha
/* jshint expr:true */
todo.completed;
return true;
},
active: function (todo) {
return !todo.completed;
},
completed: function (todo) {
return todo.completed;
}
};
// default filter
this.setFilter('all');
filters: {
filterTodos: function (todos) {
return todos.filter(filters[this.filter]);
}
},

// computed property
// http://vuejs.org/guide/computed.html
computed: {
remaining: function () {
return this.todos.filter(this.filters.active).length
return this.todos.filter(filters.active).length;
},
allDone: {
$get: function () {
Expand All @@ -78,11 +73,6 @@
// note there's no DOM manipulation here at all.
methods: {

setFilter: function (filter) {
this.filter = filter;
this.filterTodo = this.filters[filter];
},

addTodo: function () {
var value = this.newTodo && this.newTodo.trim();
if (!value) {
Expand All @@ -94,7 +84,7 @@
},

removeTodo: function (todo) {
this.todos.remove(todo.$data);
this.todos.$remove(todo.$data);
todoStorage.save();
},

Expand Down Expand Up @@ -125,12 +115,14 @@
},

removeCompleted: function () {
this.todos.remove(function (todo) {
this.todos.$remove(function (todo) {
return todo.completed;
});
todoStorage.save();
}
}
});

app.filters = filters;

})(window);
14 changes: 7 additions & 7 deletions examples/todomvc/js/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

(function (app, Router) {

'use strict'
'use strict';

var router = new Router()
var router = new Router();

Object.keys(app.filters).forEach(function (filter) {
router.on(filter, function () {
app.setFilter(filter)
})
})
app.filter = filter;
});
});

router.init()
router.init();

})(app, Router)
})(app, Router);
16 changes: 8 additions & 8 deletions examples/todomvc/js/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

(function (exports) {

'use strict'
'use strict';

var STORAGE_KEY = 'todos-vuejs'
var todos = null
var STORAGE_KEY = 'todos-vuejs';
var todos = null;

exports.todoStorage = {
fetch: function () {
if (!todos) {
todos = JSON.parse(localStorage.getItem(STORAGE_KEY) || '[]')
todos = JSON.parse(localStorage.getItem(STORAGE_KEY) || '[]');
}
return todos
return todos;
},
save: function () {
localStorage.setItem(STORAGE_KEY, JSON.stringify(todos))
localStorage.setItem(STORAGE_KEY, JSON.stringify(todos));
}
}
};

})(window)
})(window);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"grunt-karma": "~0.6.2",
"grunt-karma-coveralls": "~2.3.0",
"grunt-saucelabs": "~4.1.2",
"gulp-component": "~0.1.4",
"gulp-component": "~0.1.6",
"vinyl-fs": "~0.0.2",
"jshint-stylish": "~0.1.4",
"semver": "~2.2.1",
Expand Down
5 changes: 2 additions & 3 deletions src/batcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ BatcherProto.flush = function () {
// as we execute existing jobs
for (var i = 0; i < this.queue.length; i++) {
var job = this.queue[i]
if (job.cancelled) continue
if (job.execute() !== false) {
this.has[job.id] = false
if (!job.cancelled) {
job.execute()
}
}
this.reset()
Expand Down
2 changes: 0 additions & 2 deletions src/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ BindingProto.update = function (value) {
execute: function () {
if (!self.unbound) {
self._update()
} else {
return false
}
}
})
Expand Down
Loading