|
|
@@ -603,14 +603,23 @@ function parseAttribute(
|
|
|
name
|
|
|
)!
|
|
|
|
|
|
+ const dirName =
|
|
|
+ match[1] ||
|
|
|
+ (startsWith(name, ':') ? 'bind' : startsWith(name, '@') ? 'on' : 'slot')
|
|
|
+
|
|
|
let arg: ExpressionNode | undefined
|
|
|
|
|
|
if (match[2]) {
|
|
|
+ const isSlot = dirName === 'slot'
|
|
|
const startOffset = name.indexOf(match[2])
|
|
|
const loc = getSelection(
|
|
|
context,
|
|
|
getNewPosition(context, start, startOffset),
|
|
|
- getNewPosition(context, start, startOffset + match[2].length)
|
|
|
+ getNewPosition(
|
|
|
+ context,
|
|
|
+ start,
|
|
|
+ startOffset + match[2].length + ((isSlot && match[3]) || '').length
|
|
|
+ )
|
|
|
)
|
|
|
let content = match[2]
|
|
|
let isStatic = true
|
|
|
@@ -626,6 +635,11 @@ function parseAttribute(
|
|
|
}
|
|
|
|
|
|
content = content.substr(1, content.length - 2)
|
|
|
+ } else if (isSlot) {
|
|
|
+ // #1241 special case for v-slot: vuetify relies extensively on slot
|
|
|
+ // names containing dots. v-slot doesn't have any modifiers and Vue 2.x
|
|
|
+ // supports such usage so we are keeping it consistent with 2.x.
|
|
|
+ content += match[3] || ''
|
|
|
}
|
|
|
|
|
|
arg = {
|
|
|
@@ -647,13 +661,7 @@ function parseAttribute(
|
|
|
|
|
|
return {
|
|
|
type: NodeTypes.DIRECTIVE,
|
|
|
- name:
|
|
|
- match[1] ||
|
|
|
- (startsWith(name, ':')
|
|
|
- ? 'bind'
|
|
|
- : startsWith(name, '@')
|
|
|
- ? 'on'
|
|
|
- : 'slot'),
|
|
|
+ name: dirName,
|
|
|
exp: value && {
|
|
|
type: NodeTypes.SIMPLE_EXPRESSION,
|
|
|
content: value.content,
|