0.1.18 • Published 5 years ago
cris-header v0.1.18
cris-header
介绍
阡陌云前端路由组件,提供统一的路由入口。
使用方法
1. Vue项目
- 使用npm安装并引入,注意需要store传入作为参数
npm install cris-header- 在main.js中引入
import WorkHeader from 'cris-header'
import 'cris-header/dist/cris-header.css'
Vue.use(WorkHeader, { store })- 在页面中使用组件,根据是否是开发环境判断模块点击的路由跳转
<!-- layout.vue -->
<template>
<div>
<!-- 顶部栏 -->
<WorkHeader :isDev="isDev">
<template slot="leftSlot">
</template>
<template slot="rightSlot">
</template>
</WorkHeader>
<!-- 下方区域 -->
<div class="page-body">
<router-view />
</div>
</div>
<script>
export default {
name: "Layout",
computed() {
isDev() {
return process.env.NODE_ENV === 'development'
}
}
}
</script>- vue.config.js中路由配置(可选)
devServer: {
host: '0.0.0.0',
port: port,
open: true,
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
["/apps/cris"]: {
target: `http://localhost:8081/apps/cris`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
},
['/apps/party']: {
target: `http://localhost:8082/apps/party`,
changeOrigin: true,
pathRewrite: {
['^' + '/apps/party']: ''
}
}
},
disableHostCheck: true
},0.1.18
5 years ago
0.1.17
5 years ago
0.1.16
5 years ago
0.1.15
5 years ago
0.1.14
5 years ago
0.1.13
5 years ago
0.1.12
5 years ago
0.1.11
5 years ago
0.1.10
5 years ago
0.1.9
5 years ago
0.1.8
5 years ago
0.1.7
5 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago