【问题标题】:Vue Js Applications Failed to Display the PageVue Js 应用程序无法显示页面
【发布时间】:2019-07-06 01:13:21
【问题描述】:

我是 vue js 应用程序的新手。我正在使用 Visual Studio 2017 创建 vue js 应用程序。我正在关注教程,但是当我运行应用程序时,在这一行的 Node js 控制台窗口中出现以下错误 ....

**var vue_det = new Vue({ **// vue_det assigned not never used ..

这是 App.vue 的代码...

<template>
    <div id="app">
        <Home msg="Hello world!" />
    </div>
</template>

<script>
    import Home from './components/Home.vue';
    import component1 from './components/component1.vue';

    export default {
        name: 'app',
        components: {
            Home,
           component1

        }

    };


</script>

<style>
</style>

这是component1.vue的代码...

<template>
        <div id="intro" style="text-align:center;">
            <h1>{{ message }}</h1>
        </div>


</template>

<script type = "text/javascript">
    import Vue from 'vue'; 
         var vue_det = new Vue({
            el: '#intro',
            data: {
               message: 'My first VueJS Task'
            }
         });
      </script>

<style scoped>
</style>

这是我运行应用程序时出现错误的屏幕截图..

【问题讨论】:

    标签: javascript visual-studio vue.js


    【解决方案1】:

    这是 eslint 错误。您可以阅读消息:

    vue_det 被赋值但从未使用过

    请尝试删除它

    <script type = "text/javascript">
    import Vue from 'vue'; 
    new Vue({
    el: '#intro',
    data: {
        message: 'My first VueJS Task'
    }
    });
    </script>
    

    【讨论】:

      猜你喜欢
      • 2016-02-25
      • 2021-12-22
      • 1970-01-01
      • 2021-11-30
      • 2017-11-30
      • 2019-07-22
      • 1970-01-01
      • 1970-01-01
      • 2019-12-09
      相关资源
      最近更新 更多