2016-05-17 04:29:08 +08:00
|
|
|
'use strict'
|
|
|
|
|
2017-03-17 12:09:12 +08:00
|
|
|
process.env.NODE_ENV = 'production'
|
|
|
|
|
2016-11-17 05:41:44 +08:00
|
|
|
const Vue = require('../../dist/vue.runtime.common.js')
|
2016-06-25 12:05:39 +08:00
|
|
|
const createRenderer = require('../../packages/vue-server-renderer').createRenderer
|
2016-05-17 04:29:08 +08:00
|
|
|
const renderToString = createRenderer().renderToString
|
|
|
|
const gridComponent = require('./common.js')
|
|
|
|
|
|
|
|
console.log('--- renderToString --- ')
|
|
|
|
const self = (global || root)
|
|
|
|
self.s = self.performance.now()
|
|
|
|
|
2017-05-14 14:23:38 +08:00
|
|
|
renderToString(new Vue(gridComponent), (err, res) => {
|
|
|
|
if (err) throw err
|
|
|
|
// console.log(res)
|
2016-05-17 04:29:08 +08:00
|
|
|
console.log('Complete time: ' + (self.performance.now() - self.s).toFixed(2) + 'ms')
|
|
|
|
console.log()
|
|
|
|
})
|