diff --git a/src/compile/render-dom/index.ts b/src/compile/render-dom/index.ts index a84f8fefa6cd..039f901731ce 100644 --- a/src/compile/render-dom/index.ts +++ b/src/compile/render-dom/index.ts @@ -152,7 +152,7 @@ export default function dom( if (!options || (!options.target && !options.root)) { throw new Error("'target' is a required option"); }`} - ${storeProps.length > 0 && deindent` + ${storeProps.length > 0 && !templateProperties.store && deindent` if (!options.store) { throw new Error("${debugName} references store properties, but no store was provided"); }`} diff --git a/src/compile/render-ssr/index.ts b/src/compile/render-ssr/index.ts index a424b5c2ea02..8edc101910c3 100644 --- a/src/compile/render-ssr/index.ts +++ b/src/compile/render-ssr/index.ts @@ -115,7 +115,7 @@ export default function ssr( ${templateProperties.store && `options.store = %store();`} __result.addComponent(${name}); - ${options.dev && storeProps.length > 0 && deindent` + ${options.dev && storeProps.length > 0 && !templateProperties.store && deindent` if (!options.store) { throw new Error("${debugName} references store properties, but no store was provided"); } diff --git a/test/runtime/samples/dev-accept-declarative-store/_config.js b/test/runtime/samples/dev-accept-declarative-store/_config.js new file mode 100644 index 000000000000..5b9d5ecf1a00 --- /dev/null +++ b/test/runtime/samples/dev-accept-declarative-store/_config.js @@ -0,0 +1,5 @@ +export default { + compileOptions: { + dev: true + } +}; diff --git a/test/runtime/samples/dev-accept-declarative-store/main.html b/test/runtime/samples/dev-accept-declarative-store/main.html new file mode 100644 index 000000000000..a20bbf0d65ac --- /dev/null +++ b/test/runtime/samples/dev-accept-declarative-store/main.html @@ -0,0 +1,11 @@ +

{$foo}

+ + diff --git a/test/runtime/samples/dev-error-missing-store/_config.js b/test/runtime/samples/dev-error-missing-store-option/_config.js similarity index 100% rename from test/runtime/samples/dev-error-missing-store/_config.js rename to test/runtime/samples/dev-error-missing-store-option/_config.js diff --git a/test/runtime/samples/dev-error-missing-store/main.html b/test/runtime/samples/dev-error-missing-store-option/main.html similarity index 100% rename from test/runtime/samples/dev-error-missing-store/main.html rename to test/runtime/samples/dev-error-missing-store-option/main.html