diff --git a/src/demo/js/options/index.js b/src/demo/js/options/index.js index c5d390d7..be936771 100644 --- a/src/demo/js/options/index.js +++ b/src/demo/js/options/index.js @@ -4,7 +4,7 @@ import config from './config' import { devPrefix } from '../../../../tools/build-vars' const editorContainer = document.querySelector('.build-form') -const renderContainer = document.querySelector('.render-form') +const renderContainer = '.render-form' export const editorOptions = { editorContainer, diff --git a/src/js/renderer.js b/src/js/renderer.js index bedb3ee3..38de03ef 100644 --- a/src/js/renderer.js +++ b/src/js/renderer.js @@ -5,9 +5,11 @@ import { STAGE_CLASSNAME, UUID_REGEXP } from './constants' const RENDER_PREFIX = 'f-' -const processOptions = ({ container, ...opts }) => { +const processOptions = ({ editorContainer, renderContainer, ...opts }) => { + const containerLookup = container => (typeof container === 'string' ? document.querySelector(container) : container) const processedOptions = { - container: typeof container === 'string' ? document.querySelector(container) : container, + renderContainer: containerLookup(renderContainer), + editorContainer: containerLookup(editorContainer), } return Object.assign({}, opts, processedOptions)