小编Lan*_*nsi的帖子

删除 Vue Router 中的尾部斜杠

const routes = [
  {
    path: '/:year',
    component: Nav,
    children: [
      { path: '', name: 'test', component: Test }
    ]
  }
];
Run Code Online (Sandbox Code Playgroud)
<!-- /2018/ -->
<router-link :to="{name: 'test', params: {year: 2018}}"></router-link>
Run Code Online (Sandbox Code Playgroud)

如果有孩子,我想删除添加到路由器链接创建的路径的尾部斜杠。

vue.js vue-router

6
推荐指数
1
解决办法
3374
查看次数

退出时节点js进程不能永远使用

我想要一些关于流程退出的工作.

但是process.on('exit')没有使用express或socket.io或mysql等工作.

process.on('exit', function() {
    console.log('Server exit.');
});
Run Code Online (Sandbox Code Playgroud)

只有这段代码正常工作.

var mysql = require('mysql');
var conn = mysql.createConnection();

conn.connect();

process.on('exit', function() {
    console.log('Server exit.');
});
Run Code Online (Sandbox Code Playgroud)

这不起作用.

node.js

5
推荐指数
1
解决办法
3516
查看次数

标签 统计

node.js ×1

vue-router ×1

vue.js ×1