Vue Uncaught TypeError Cannot read property get of undefined error

problem description

the environmental background of the problems and what methods you have tried

there is no problem with direct access through the browser, but write it to get () and report an error
Uncaught TypeError: Cannot read property "get" of undefined

.

related codes

/ / Please paste the code text below (do not replace the code with pictures)


< head >
< meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" / >

<title>vue helloword</title>
<script src="js/vue.js"></script>

< / head >
< body >

<div id="app">
    {{ message }}
</br>
    <input type="text" v-model="message"/>
    <button v-on:click="get1"></button>
</div>
<script>
    var app=new Vue({
        el: "-sharpapp",
        data: {
            message: "hello Word",
            url:"http://localhost:8080/api/infonSace"
        },
        methods:{
            get1:function(){
                this.$http.get("http://localhost:8080/api/infonSace").then(res=>{
                // 
                console.log(res.data);                  
            },err=>{
                console.log(err);
            });
        }
      }
    });
</script>

< / body >
< / html >

what result do you expect? What is the error message actually seen?

did I write something wrong? Ask the Great God for advice

Jun.03,2021
Menu