diff --git a/README.md b/README.md index 15b45410..be041995 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,19 @@ import '@vue/repl/style.css' import { watchEffect } from 'vue' import { Repl, ReplStore } from '@vue/repl' +// retrieve some configuration options from the URL +const query = new URLSearchParams(location.search) + const store = new ReplStore({ // initialize repl with previously serialized state serializedState: location.hash.slice(1), + // starts on the output pane (mobile only) if the URL has a showOutput query + showOutput: query.has('showOutput'), + // starts on a different tab on the output pane if the URL has a outputMode query + // and default to the "preview" tab + outputMode: (query.get('outputMode') || 'preview') + // specify the default URL to import Vue runtime from in the sandbox // default is the CDN link from unpkg.com with version matching Vue's version // from peerDependency diff --git a/src/SplitPane.vue b/src/SplitPane.vue index d8bfbfe9..274445ff 100644 --- a/src/SplitPane.vue +++ b/src/SplitPane.vue @@ -1,5 +1,6 @@