[Vuejs]-VUE.JS render function

0👍

In redux, you can indeed mix HTML markup with JavaScript. But there’s no such thing in Vue.js. The only way would be to wrap your HTML in template string:

return(`
    <div id='mobiledoc-toolbar'>
    ...
    </div>
`

or to use <template> template format for vue (if you’re using webpack). Such components look like this:

<template>
  <div id="toolbar">
  </div>
</template>

<script>
    export default new Vue(

    );
</script>

<style lang="scss">
  // Your styles here
</style>

and then no render() method is necessary.

PS: Yes, as @Bert suggested, you can also use Babel JSX Transform plugin and use JSX syntax.

Leave a comment