B
B
beduin012015-12-26 17:16:13
Vue.js
beduin01, 2015-12-26 17:16:13

Vue.js how to write hello world correctly?

Started learning vue.js first copy-pasted the example from here:
https://jsfiddle.net/yyx990803/okv0rgrk/

However nothing works:
img.ctrlv.in/img/15/12/26/567ea09a7598c.png

What am I doing wrong ?

In the console it says: [Vue warn]: Cannot find element: #app

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivanq, 2015-12-26
@beduin01

Connected right? Are there any errors in the console? By the way, on jsfiddle the script is executed after loading (in the onload event), while yours is outside. Try writing something like

window.onload = function() {
    new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue.js!'
        }
    });
}

D
Dmitry Gavrilenko, 2015-12-26
@Maddox

Check your console. There's a lot of useful information to be found there.
write as Ivanq indicated in the comments , i.e.

window.onload = function() {
    new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue.js!'
        }
    });
};

It worked for me.

A
Andrew, 2014-05-28
@OLS

I would say that by going into a geometric interpretation, you begin to give events with a larger "x" more weight in the calculation of the result (as if they happen more often) and because of this you distort the result.
I think the answer should be around (1+ln(3))/3, but according to your geometric interpretation it is 5/9.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question