Alex
Alex

Reputation: 68492

.vue files without jsx

Is there a way to have .vue files for each component, but without that pseudo-javascript language jsx ?

I like the idea of having all the components and templates in separate files, but that stupid "language" is freaking me out.

Upvotes: 1

Views: 552

Answers (3)

Hozhabr
Hozhabr

Reputation: 452

 ///// example.vue
<temlate>
    // Write Html codes .....
</temlate>

<style lang="scss" scoped>
    // Write isolate style
</style>

<script>
////    Example javascript code
import { mapState } from 'vuex';
import PageBreadcrumb from './breadcrumb';
import IssuePage from '~/components/common/issue-page';

export default {
    components: {
        PageBreadcrumb
    },
    extends: IssuePage,
    computed: {
        ...mapState('domestic', ['confirmInfo']),
        urlSuffix: () => 'domestic-flights'
    }
};
</script>

Upvotes: 1

Pierre Troll&#233;
Pierre Troll&#233;

Reputation: 426

Yes. Just use the vue cli to generate a first step project. You won't have any JSX inside your code.

Upvotes: 1

Matthias S
Matthias S

Reputation: 3563

You don't need to use jsx in .vue files.

Just write plain HTML

Example.vue

<template>
    <div>
        Hello, I am just HTML
    </div>
</template>

<script>
    export default {}
</script>

Upvotes: 2

Related Questions