|
|
@@ -22,7 +22,7 @@ import {
|
|
|
// special binding prefixes
|
|
|
const bindRE = /^v-bind:|^:/
|
|
|
const onRE = /^v-on:|^@/
|
|
|
-const argRE = /:(.*)$/
|
|
|
+const dirAttrRE = /^v-([^:]+)(?:$|:(.*)$)/
|
|
|
const modifierRE = /\.[^\.]+/g
|
|
|
const transitionRE = /^(v-bind:|:)?transition$/
|
|
|
|
|
|
@@ -646,7 +646,7 @@ function makeTerminalNodeLinkFn (el, dirName, value, options, def) {
|
|
|
function compileDirectives (attrs, options) {
|
|
|
var i = attrs.length
|
|
|
var dirs = []
|
|
|
- var attr, name, value, rawName, rawValue, dirName, arg, modifiers, dirDef, tokens
|
|
|
+ var attr, name, value, rawName, rawValue, dirName, arg, modifiers, dirDef, tokens, matched
|
|
|
while (i--) {
|
|
|
attr = attrs[i]
|
|
|
name = rawName = attr.name
|
|
|
@@ -700,14 +700,9 @@ function compileDirectives (attrs, options) {
|
|
|
} else
|
|
|
|
|
|
// normal directives
|
|
|
- if (name.indexOf('v-') === 0) {
|
|
|
- // check arg
|
|
|
- arg = (arg = name.match(argRE)) && arg[1]
|
|
|
- if (arg) {
|
|
|
- name = name.replace(argRE, '')
|
|
|
- }
|
|
|
- // extract directive name
|
|
|
- dirName = name.slice(2)
|
|
|
+ if ((matched = name.match(dirAttrRE))) {
|
|
|
+ dirName = matched[1]
|
|
|
+ arg = matched[2]
|
|
|
|
|
|
// skip v-else (when used with v-show)
|
|
|
if (dirName === 'else') {
|