Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/393.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 index.html中声明的Vue.js css和js无效_Javascript_Vue.js - Fatal编程技术网

Javascript index.html中声明的Vue.js css和js无效

Javascript index.html中声明的Vue.js css和js无效,javascript,vue.js,Javascript,Vue.js,我下载了一个提供html、css3、js文件的主题 我添加了路径,如下所示 <!-- Basic --> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Porto - Responsive HTML5 Template 7.5.0</title> <meta name="keywords" content=

我下载了一个提供html、css3、js文件的主题 我添加了路径,如下所示

<!-- Basic -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title>Porto - Responsive HTML5 Template 7.5.0</title>

<meta name="keywords" content="HTML5 Template" />
<meta name="description" content="Porto - Responsive HTML5 Template">
<meta name="author" content="okler.net">

<!-- Theme CSS -->
<link rel="stylesheet" href="/static/css/theme.css">
<link rel="stylesheet" href="/static/css/theme-elements.css">
<link rel="stylesheet" href="/static/css/theme-blog.css">
<link rel="stylesheet" href="/static/css/theme-shop.css">

<!-- Current Page CSS -->
<link rel="stylesheet" href="/static/vendor/rs-plugin/css/settings.css">
<link rel="stylesheet" href="/static/vendor/rs-plugin/css/layers.css">
<link rel="stylesheet" href="/static/vendor/rs-plugin/css/navigation.css">

<!-- Demo CSS -->


<!-- Skin CSS -->
<link rel="stylesheet" href="/static/css/skins/skin-corporate-5.css">

<!-- Theme Custom CSS -->
<link rel="stylesheet" href="/static/css/custom.css">

<!-- Head Libs -->
<script src="/static/vendor/modernizr/modernizr.min.js"></script>

有没有办法再次加载整个index.html?还是其他解决此问题的方法?

尝试在main.js中添加脚本,并直接在App.vue文件中添加样式表。我在导入index.html文件中的文件时遇到很多问题。但是当我移动所有导入时,一切都正常。

不要在index.html文件路径中写入静态文件,而是使用。 例如,不要使用
href=“/static/vendor/modernizr/modernizr.min.js”
添加所有css和脚本文件,而是这样编写
href=“/vendor/modernizr.min.js”

它已经解决了
<template>
    <div role="main" class="main">
        test
    </div>
</template>

<script>
    import "/static/js/theme.js"
</script>
This dependency was not found:

* /static/js/theme.js in ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/parents/Robot.vue

To install it, you can run: npm install --save /static/js/theme.js