vue3-core/packages/runtime-test
Evan You 27e1e38641 release: v3.3.0-alpha.5 2023-03-26 16:52:46 +08:00
..
__tests__ fix(build): avoid const enum conflicts 2023-02-06 09:44:12 +08:00
src fix(build): avoid const enum conflicts 2023-02-06 09:44:12 +08:00
LICENSE
README.md build: adjust build formats 2020-04-19 18:43:21 -04:00
index.js
package.json release: v3.3.0-alpha.5 2023-03-26 16:52:46 +08:00

README.md

@vue/runtime-test

This is for Vue's own internal tests only - it ensures logic tested using this package is DOM-agnostic, and it runs faster than JSDOM.

It can also be used as a reference for implementing a custom renderer.

import { h, render, nodeOps, dumpOps } from '@vue/runtime-test'

const App = {
  data () {
    return {
      msg: 'Hello World!'
    }
  }
  render () {
    return h('div', this.msg)
  }
}

// root is of type `TestElement` as defined in src/nodeOps.ts
const root = nodeOps.createElement('div')
render(h(App), root)

const ops = dumpOps()
console.log(ops)