8000 raise default priority, fix custom directive params processing order … · zhangking/vue@97d8862 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97d8862

Browse files
committed
raise default priority, fix custom directive params processing order (fix vuejs#1662)
1 parent 722fc5e commit 97d8862

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

examples/select2/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<div id="el">
1919
<p>Selected: {{selected}}</p>
20-
<select v-select="selected" options="options">
20+
<select v-select="selected" :options="options">
2121
<option value="0">default</option>
2222
</select>
2323
</div>

src/compiler/compile.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ var terminalDirectives = [
2020
'if'
2121
]
2222

23+
// default directive priority
24+
var DEFAULT_PRIORITY = 1000
25+
2326
/**
2427
* Compile a template and return a reusable composite link
2528
* function, which recursively contains more link functions
@@ -102,8 +105,8 @@ function linkAndCapture (linker, vm) {
102105
*/
103106

104107
function directiveComparator (a, b) {
105-
a = a.descriptor.def.priority || 0
106-
b = b.descriptor.def.priority || 0
108+
a = a.descriptor.def.priority || DEFAULT_PRIORITY
109+
b = b.descriptor.def.priority || DEFAULT_PRIORITY
107110
return a > b ? -1 : a === b ? 0 : 1
108111
}
109112

0 commit comments

Comments
 (0)
0