diff --git a/src/core/instance/render.js b/src/core/instance/render.js index 1a5e004aa7b..fc46a531eed 100644 --- a/src/core/instance/render.js +++ b/src/core/instance/render.js @@ -117,8 +117,10 @@ export function renderMixin (Vue: Class) { tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy) if (Array.isArray(tree)) { for (let i = 0; i < tree.length; i++) { - tree[i].isStatic = true - tree[i].key = `__static__${index}_${i}` + if (typeof tree[i] !== 'string') { + tree[i].isStatic = true + tree[i].key = `__static__${index}_${i}` + } } } else { tree.isStatic = true diff --git a/test/unit/features/component/component-slot.spec.js b/test/unit/features/component/component-slot.spec.js index ed4d2920547..524d65a4ea8 100644 --- a/test/unit/features/component/component-slot.spec.js +++ b/test/unit/features/component/component-slot.spec.js @@ -523,4 +523,17 @@ describe('Component slot', () => { expect(spy).toHaveBeenCalled() }).then(done) }) + + it('renders static tree with text', () => { + const vm = new Vue({ + template: `
`, + components: { + test: { + template: '
' + } + } + }) + vm.$mount() + expect('Error when rendering root').not.toHaveBeenWarned() + }) })