我正在尝试在`react-router-dom v6.0中组织路由。这是我的流程:
根应用程序组件
function AppComponent() {
return <AppRoute />;
}
Run Code Online (Sandbox Code Playgroud)
AppRoute.js(基本路由)
const AppRoute = () => {
return (
<>
<GuestRoute path="/login" component={Login} />
</>
);
};
Run Code Online (Sandbox Code Playgroud)
访客路线
const GuestRoute = ({ component: Component, ...rest }) => {
return (
<GuestLayout>
<Routes>
<Route {...rest} element={<Component />} />
</Routes>
</GuestLayout>
);
};
Run Code Online (Sandbox Code Playgroud)
宾客布局
const GuestLayout = ({ children, ...rest }) => {
return (
<div>
{children}
</div>
);
};
Run Code Online (Sandbox Code Playgroud)
但是,当我转到 时/login,它并没有破坏页面,但仍然显示 的警告No routes matched location "/login"。我在用react-router-dom …
你可以直接去UPDATE 2
我有一个巨大的表,所以获取偏移,限制不会工作,因为它需要很长时间.所以,我正在考虑转向密钥搜索分页方法,因此我的查询将针对每次点击进行不同,如下所述:
/*First*/
select top (1000) id, name from table_name order by id desc;
/*returns data from 56679923-56678924*/
/*Next*/
select top (1000) id,name from table_name where id < @previous_lowest_id order by id desc;
/*returns data from 56678923-56677924*/
/*Previous*/
SELECT * FROM
(select top (1000) id,name
from table_name
where id > @previous_highest_id
order by id asc
) as myAlias
ORDER BY id desc;
/*returns data from 56679923-56678924*/
/*Last*/
SELECT * FROM
(select top (1000) id,name
from table_name
order by id …Run Code Online (Sandbox Code Playgroud) 即使 127.0.0.1 无法正常工作,我也面临访问 localhost 的问题;从我自己的电脑上。但是,我对 /phpmyadmin 没有问题。我正在使用 wamp 2.5 Apache/2.4.9 (Win64) PHP/5.5.12 服务器,位于 127.0.0.1 端口 80,用于 win 8.1。
httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here …Run Code Online (Sandbox Code Playgroud) 我通过以下方式创建了虚拟主机:
- cd /etc/apache2/sites-available
- sudo nano laravel.test.conf
Run Code Online (Sandbox Code Playgroud)
laravel.test.conf为<VirtualHost *:80>
ServerName laravel.test
ServerAlias www.laravel.test
ServerAdmin admin@laravel.test
DocumentRoot /var/www/laravel/public
<Directory /var/www/laravel/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
运行命令:sudo a2ensite laravel.test
提供的许可:
sudo chown -R www-data: /var/www/laravel
sudo chown -R $USER:$USER /var/www/laravel
sudo chmod -R 755 /var/www
Run Code Online (Sandbox Code Playgroud)
etc/hosts127.0.0.1 laravel.test www.laravel.test
Run Code Online (Sandbox Code Playgroud)
重新加载阿帕奇sudo systemctl reload apache2
运行 configtestsudo apachectl configtest并收到Syntax Ok …
apache ×2
datatables ×1
javascript ×1
jquery ×1
lamp ×1
pagination ×1
php ×1
reactjs ×1
virtualhost ×1
wamp ×1