2nthony / dvan

🛠️Yet another config-free JavaScript bundler
https://dvan.js.org
MIT License
6 stars 0 forks source link

Command: `vue-sfc` #20

Closed 2nthony closed 5 years ago

2nthony commented 5 years ago

This command can run a vue file in browser directly.

But need a better way to test its props and events 🤔

Now idea is create a file

Use render function maybe better

// vue-sfc.config.js
export default {
  attrs: {...},
  props: {...},
  on: {...}
}

interface config {
  attrs?: any,
  props?: any,
  on?: any,
  [key: string]: any
}

// render in vue
{
  render(h) {
    return h('your component', {...})
  }
}

Please see: https://vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth

2nthony commented 5 years ago

Maybe use vue-dev-server https://github.com/vuejs/vue-dev-server will be better.