Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/432.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 警报将不适用于vuejs_Javascript_Vue.js - Fatal编程技术网

Javascript 警报将不适用于vuejs

Javascript 警报将不适用于vuejs,javascript,vue.js,Javascript,Vue.js,我跟在后面。我正在使用netbeans 8.1。按下submit按钮时,vue对象中的警报不会出现,而是出现默认的html操作done.html。控制台中的唯一错误是: GET http://localhost:8383/favicon.ico net::ERR_EMPTY_RESPONSE 我的代码就在网络广播中: <!DOCTYPE html> <!-- To change this license header, choose License H

我跟在后面。我正在使用netbeans 8.1。按下submit按钮时,vue对象中的警报不会出现,而是出现默认的html操作done.html。控制台中的唯一错误是:

GET http://localhost:8383/favicon.ico net::ERR_EMPTY_RESPONSE
我的代码就在网络广播中:

    <!DOCTYPE html>
    <!--
    To change this license header, choose License Headers in Project Properties.
    To change this template file, choose Tools | Templates
    and open the template in the editor.
    auth0.com/blog/2015/11/13/build-an-app-with-vuejs/


    -->
    <!--<html>-->
        <head>
            <title>TODO supply a title</title>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <link rel="shortcut icon" href="">




        </head>
        <body>
            <div id="app">  
                <form action="done.html">

                    <button type="submit" v-on:submit="handleIt">        
                    <!--<button>-->        
                        submit me!!       
                    </button>





                    <pre> {{$data|json}}</pre>
                </form>



            </div>

            <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.12/vue.js"></script>

            <script>

    //            var data = {message: "hi there"}

            new Vue({
                el: '#app',
                methods: {
                        handleIt: function()
                            {alert('hgjfhgjf');}
                    }
                });

            </script>
        </body>
    </html>

提供头衔
提交我!!
{{$data | json}
//var data={消息:“你好”}
新Vue({
el:“#应用程序”,
方法:{
handleIt:function()
{alert('hgjfhgjf');}
}
});

我做错了什么?

我不是
vuejs
专家,但是,据我所知,您必须在表单元素上放置
v-on:submit
,就像这样

我不是
vuejs
专家,但是,据我所知,您必须在表单元素上放置
v-on:submit
,像这样

我忘了在HTML文件中添加vue_实例文件。

我忘了在HTML文件中添加vue_实例文件。

为什么
被注释掉了?''在topOkay,那么
在哪里?我以为它们是一样的东西为什么
被注释掉了?''在topOkay,那么
在哪里?我还以为它们是一样的呢