我如何要求 vue-server-renderer
代替import
?
const renderer = require('vue-server-renderer').createRenderer()
我试过了:
import renderer from 'vue-server-renderer'
const vueRenderer = renderer.createRenderer()
错误:
var vueRenderer = _vueServerRenderer2.default.createRenderer();
^
TypeError: Cannot read property 'createRenderer' of undefined
有什么想法吗?
答案 0 :(得分:2)
createRenderer
- 包vue-server-renderer
import {createRenderer} from 'vue-server-renderer'
const renderer = createRenderer()