D
D
danilr2020-02-19 08:01:42
Vue.js
danilr, 2020-02-19 08:01:42

How to work with Vue with JSX and templates?

I recently learned that Vue has the ability to use JSX.
5e4cc148282f6536586493.png
And as they write that now JSX is in all methods, but for some reason when I tried to make a method on JSX, everything breaks.

methods: {
renderButton(text) {
            const myText = text +' '+' Render Work!!!';

            return (<button>{myText}</button>);
        },
}

I correctly understood that it is possible to have both a template and JSX render methods in a component that will be inserted there? Or is it necessary to choose one of the two? Tell me please. Also, if it is important, now in my project Vue is connected as cdn and without components, only an instance. <templates>...</templates>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2020-02-19
@danilr

Vue connects like a cdn and no components, just an instance.

won't take off

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question