raise default priority, fix custom directive params processing order (fix #1662)

This commit is contained in:
Evan You 2015-10-31 16:25:08 -04:00
parent 722fc5ed0e
commit 97d886216b
2 changed files with 6 additions and 3 deletions

View File

@ -17,7 +17,7 @@
<div id="el">
<p>Selected: {{selected}}</p>
<select v-select="selected" options="options">
<select v-select="selected" :options="options">
<option value="0">default</option>
</select>
</div>

View File

@ -20,6 +20,9 @@ var terminalDirectives = [
'if'
]
// default directive priority
var DEFAULT_PRIORITY = 1000
/**
* Compile a template and return a reusable composite link
* function, which recursively contains more link functions
@ -102,8 +105,8 @@ function linkAndCapture (linker, vm) {
*/
function directiveComparator (a, b) {
a = a.descriptor.def.priority || 0
b = b.descriptor.def.priority || 0
a = a.descriptor.def.priority || DEFAULT_PRIORITY
b = b.descriptor.def.priority || DEFAULT_PRIORITY
return a > b ? -1 : a === b ? 0 : 1
}