mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-05 05:27:59 +08:00
raise default priority, fix custom directive params processing order (fix #1662)
This commit is contained in:
parent
722fc5ed0e
commit
97d886216b
@ -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>
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user