G
G
gsdev992019-02-03 15:48:22
Vue.js
gsdev99, 2019-02-03 15:48:22

Is there a React.Fragment equivalent in Vue.js?

Hello. Can you please tell me if there is an analogue of React.Fragment in Vue.js?
React

import React, { Component } from 'react'

export default class Counter extends Component {

  render() {
    return (
      <React.Fragment>
        <h2>Counter</h2>
      </React.Fragment>
    )
  }
}

vue
<template>
  <div>
    <h2>{{ counter }}</h2>
  </div>
</template>

<script>
export default {
  data() {
    return {
      counter: 0
    }
  }
}
</script>

<style scoped>

</style>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0xD34F, 2019-02-03
@gsdev99

No. There are crutches ( for example ) - you can use them. Well, or wait for Vue 3 - they say it will be there.

P
Philip Gaponenko, 2019-02-03
@filgaponenko

What's wrong with template ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question