我在使用Vue时出现,vue.js:600 [Vue警告]:在ASP.NET MVC Razor上编译模板时出错

时间:2018-10-10 09:37:32

标签: c vue.js

我在使用Vue时出现

vue.js:600 [Vue警告]:在ASP.NET MVC剃刀布局上编译模板时出错。

我在使用Vue时出现

vue.js:600 [Vue警告]:在ASP.NET MVC剃刀布局上编译模板时出错。

我在使用Vue时出现

vue.js:600 [Vue警告]:在ASP.NET MVC剃刀布局上编译模板时出错。

  

_Layout.cshtml ##

<!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>@ViewData["Title"] - 员工点餐系统</title>
        <!-- 引入样式 -->
        <link href="~/lib/element-ui2/theme-chalk/index.css" rel="stylesheet" />
        <link href="~/css/_layout.css" rel="stylesheet" />
        @*@RenderSection("css")*@
        <!-- import Vue before Element -->
        <script src="~/lib/vue/vue.js"></script>
        <!-- 引入组件库 -->
        <script src="~/lib/element-ui2/index.js"></script>
        <script src="~/lib/jquery/jquery.js"></script>

    </head>
    <body>
        <div id="app-layout" style="height:100%">
            <el-container style="height:100%">
                <el-aside width="250px">
                    <el-row style="height:100%">
                        <el-col :span="24" style="height:100%">
                            <el-menu default-active="2" style="height:100%"
                                     class="el-menu-vertical-demo"
                                     background-color="#545c64"
                                     text-color="#fff"
                                     active-text-color="#ffd04b">

                                <el-menu-item index="2">
                                    <i class="el-icon-menu"></i>
                                    <span slot="title">菜品管理</span>
                                </el-menu-item>
                                <el-menu-item index="3">
                                    <i class="el-icon-menu"></i>
                                    <span slot="title">菜品分类管理</span>
                                </el-menu-item>
                                <el-menu-item index="4">
                                    <i class="el-icon-menu"></i>
                                    <span slot="title">员工管理</span>
                                </el-menu-item>
                            </el-menu>
                        </el-col>
                    </el-row>
                </el-aside>
                <el-container>
                    <el-header class="el-header" style="padding:0px">
                        <el-card>
                            <el-breadcrumb separator-class="el-icon-arrow-right">
                                <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                                <el-breadcrumb-item>活动管理</el-breadcrumb-item>
                                <el-breadcrumb-item>活动列表</el-breadcrumb-item>
                                <el-breadcrumb-item>活动详情</el-breadcrumb-item>
                            </el-breadcrumb>
                        </el-card>
                    </el-header>
                    <el-main style="overflow: hidden;">
                            @RenderBody()
                    </el-main>
                </el-container>
            </el-container>
        </div>
        <script>
            var app = new Vue({
                el: "#app-layout"
            });
        </script>
    </body>
    </html>
  

Index.cshtml

@{ 
    Layout = "_layout";
}
<div id="app-index">

</div>

<script>
    var app = new Vue({
        el: "#app-index",
        data: {
        },
        methods: {
            submitDish: function () {
                var that = this;
                app.$loading({
                    lock: true,
                    text: 'Loading',
                    spinner: 'el-icon-loading'
                });
                $.ajax({
                    url: '../Home/index',
                    type: 'post',
                    dataType: 'json',
                    data: that.form
                    //success: function (r) {
                    //    if (r.result === false) {
                    //        alert(r.message);
                    //    }
                    //    else {
                    //        window.location.href = r.url;
                    //    }
                    //}
                });
            }
        }
    });
</script>

0 个答案:

没有答案