diff --git a/src/shared/index.js b/src/shared/index.js index cf953e4bf1..d9d6475e64 100644 --- a/src/shared/index.js +++ b/src/shared/index.js @@ -100,7 +100,7 @@ export function observe(key, callback, options) { } export function observeDev(key, callback, options) { - var c = (key = '' + key).search(/[^\w]/); + var c = (key = '' + key).search(/[.[]/); if (c > -1) { var message = 'The first argument to component.observe(...) must be the name of a top-level property'; diff --git a/test/runtime/samples/store-observe-dollar/_config.js b/test/runtime/samples/store-observe-dollar/_config.js new file mode 100644 index 0000000000..1861b937d9 --- /dev/null +++ b/test/runtime/samples/store-observe-dollar/_config.js @@ -0,0 +1,25 @@ +import { Store } from '../../../../store.js'; + +const store = new Store({ + name: 'world' +}); + +export default { + store, + + html: `