mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
router
This commit is contained in:
parent
ea16b3353b
commit
e6c4f9ebf2
@ -8,9 +8,9 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
mobileUrl() {
|
mobileUrl() {
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
return '/vue/examples#' + location.pathname.slice(4);
|
return '/zanui/vue/examples#' + location.pathname;
|
||||||
} else {
|
} else {
|
||||||
return '/examples.html#' + location.pathname.slice(4);
|
return '/examples.html#' + location.pathname;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -15,6 +15,7 @@ Vue.use(ZanUI.Lazyload, {
|
|||||||
});
|
});
|
||||||
Vue.use(VueRouter);
|
Vue.use(VueRouter);
|
||||||
|
|
||||||
|
const isProduction = process.env.NODE_ENV === 'production';
|
||||||
const routesConfig = routes(navConfig, true);
|
const routesConfig = routes(navConfig, true);
|
||||||
routesConfig.push({
|
routesConfig.push({
|
||||||
path: '/',
|
path: '/',
|
||||||
@ -22,7 +23,7 @@ routesConfig.push({
|
|||||||
});
|
});
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
mode: 'hash',
|
mode: 'hash',
|
||||||
base: '/zanui/vue',
|
base: isProduction ? '/zanui/vue/' : __dirname,
|
||||||
routes: routesConfig
|
routes: routesConfig
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import routes from './router.config';
|
|||||||
import ZanUI from 'src/index.js';
|
import ZanUI from 'src/index.js';
|
||||||
import packageJson from '../../package.json';
|
import packageJson from '../../package.json';
|
||||||
|
|
||||||
|
const isProduction = process.env.NODE_ENV === 'production';
|
||||||
const global = {
|
const global = {
|
||||||
version: packageJson.version
|
version: packageJson.version
|
||||||
};
|
};
|
||||||
@ -34,7 +35,7 @@ routesConfig.push({
|
|||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
mode: 'history',
|
mode: 'history',
|
||||||
base: '/zanui/vue',
|
base: isProduction ? '/zanui/vue/' : __dirname,
|
||||||
routes: routesConfig
|
routes: routesConfig
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -43,7 +44,7 @@ router.beforeEach((route, redirect, next) => {
|
|||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pathname = process.env.NODE_ENV === 'production' ? '/vue/examples' : '/examples.html';
|
const pathname = isProduction ? '/vue/examples' : '/examples.html';
|
||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
window.location.replace(pathname);
|
window.location.replace(pathname);
|
||||||
return;
|
return;
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
@e content {
|
@e content {
|
||||||
padding: 15px 20px;
|
padding: 15px 20px;
|
||||||
min-height: 36px;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
@ -71,6 +70,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@e btn {
|
@e btn {
|
||||||
|
font-size: 16px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
border: 0;
|
border: 0;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user