mirror of https://github.com/vuejs/vue.git
move terminal directives list to config
This commit is contained in:
parent
f7e571c468
commit
a439fa2722
|
|
@ -494,29 +494,24 @@ function makeParamsLinkFn (params, options) {
|
|||
* @return {Function} terminalLinkFn
|
||||
*/
|
||||
|
||||
var terminalDirectives = [
|
||||
'repeat',
|
||||
'if',
|
||||
'component'
|
||||
]
|
||||
|
||||
function skip () {}
|
||||
skip.terminal = true
|
||||
|
||||
function checkTerminalDirectives (el, options) {
|
||||
if (_.attr(el, 'pre') !== null) {
|
||||
return skip
|
||||
}
|
||||
var value, dirName
|
||||
var dirs = config._terminalDirectives
|
||||
/* jshint boss: true */
|
||||
for (var i = 0; i < 3; i++) {
|
||||
dirName = terminalDirectives[i]
|
||||
if (value = _.attr(el, dirName)) {
|
||||
for (var i = 0, l = dirs.length; i < l; i++) {
|
||||
dirName = dirs[i]
|
||||
if ((value = _.attr(el, dirName)) !== null) {
|
||||
return makeTerminalNodeLinkFn(el, dirName, value, options)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function skip () {}
|
||||
skip.terminal = true
|
||||
|
||||
/**
|
||||
* Build a node link function for a terminal directive.
|
||||
* A terminal link function terminates the current
|
||||
|
|
|
|||
|
|
@ -62,7 +62,18 @@ module.exports = {
|
|||
* @type {Boolean}
|
||||
*/
|
||||
|
||||
_delimitersChanged: true
|
||||
_delimitersChanged: true,
|
||||
|
||||
/**
|
||||
* List of directives that are "terminal", i.e. handles
|
||||
* the compilation of its own content
|
||||
*/
|
||||
|
||||
_terminalDirectives: [
|
||||
'repeat',
|
||||
'if',
|
||||
'component'
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue