各位晚上好,
我将不胜感激任何帮助。
我得到了这两条路线:
app.get('/', function(req,res){
res.render('index');
});
app.get('/registration/add', function(req,res){
res.render('clientRegistration');
});
Run Code Online (Sandbox Code Playgroud)
这是服务器的一部分:
app.use( express.static(path.join( __dirname, './client/static/')));
app.use(body_parser.urlencoded());
app.set( "views", path.join(__dirname, "./client/views/"));
app.set( "view engine", 'ejs');
Run Code Online (Sandbox Code Playgroud)
目录是:
MyApp/
client/
static/
registration.css
styles.css
views/
index.ejs
clientRegistration.ejs
Run Code Online (Sandbox Code Playgroud)
在我的 index.ejs 上,我有: link rel="stylesheet" type="text/css" href="styles.css" 可以完美加载 .css 文件。但是,当我单击index.ejs上的链接:a href="/registration/add">时,它会将我带到clientRegistration.ejs页面,但即使我有:link rel="stylesheet",但registration.css也不会加载类型=“文本/css”href=“registration.css”
我究竟做错了什么?
谢谢你的时间。
我有一个以vue-cli webpack开头的VueJS项目。我有一个具有所有组件所需功能的javascript库。我想知道我需要在哪里放置此文件夹,以及如何在Component1.vue中从JSLibrary1调用函数:
-myJSLibrary
JSLibrary1.js
JSLibrary2.js
Run Code Online (Sandbox Code Playgroud)
JSLibrary1.js
var A = A || (function() {
class B {
function C(){
return “hello”;
}
}
var obj = new B();
return obj;
}());
Run Code Online (Sandbox Code Playgroud)
项目结构
VueProject
build
config
src
assets
components
Component1.vue
App.vue
main.js
static
Run Code Online (Sandbox Code Playgroud)
谢谢。