diff --git a/src/parse/state/tag.ts b/src/parse/state/tag.ts index 43e685017b..2dffd9f2b7 100644 --- a/src/parse/state/tag.ts +++ b/src/parse/state/tag.ts @@ -379,7 +379,7 @@ function readAttribute(parser: Parser, uniqueNames: Set) { parser.allowWhitespace(); const colon_index = name.indexOf(':'); - const type = colon_index !== 1 && get_directive_type(name.slice(0, colon_index)); + const type = colon_index !== -1 && get_directive_type(name.slice(0, colon_index)); let value: any[] | true = true; if (parser.eat('=')) { diff --git a/test/runtime/samples/prop-not-action/Nested.html b/test/runtime/samples/prop-not-action/Nested.html new file mode 100644 index 0000000000..b1029d2ad5 --- /dev/null +++ b/test/runtime/samples/prop-not-action/Nested.html @@ -0,0 +1 @@ +

Hello {user.name}!

\ No newline at end of file diff --git a/test/runtime/samples/prop-not-action/_config.js b/test/runtime/samples/prop-not-action/_config.js new file mode 100644 index 0000000000..17ab47b584 --- /dev/null +++ b/test/runtime/samples/prop-not-action/_config.js @@ -0,0 +1,9 @@ +export default { + props: { + currentUser: { name: 'world' } + }, + + html: ` +

Hello world!

+ ` +}; \ No newline at end of file diff --git a/test/runtime/samples/prop-not-action/main.html b/test/runtime/samples/prop-not-action/main.html new file mode 100644 index 0000000000..c0ddd01e79 --- /dev/null +++ b/test/runtime/samples/prop-not-action/main.html @@ -0,0 +1,6 @@ + + + \ No newline at end of file