0.1.6 • Published 6 months ago
meixisetting v0.1.6
meixisetting
用于子系统中的用户设置,包含设置账户与设置账户密码功能。
项目结构
|-- packages -----------------------------------------组件目录
| |-- config.ts
| |-- index.js
| |-- index.ts
| |-- storeTagRouter.ts
| |-- type.d.ts
| |-- component
| | |-- pages ------------------------------------路由页面
| | |-- settingAccount------------------------用户设置页面
| | | |-- index.vue
| | | |-- component
| | | | |-- applyGenForm.vue
| | | | |-- applyQuiteForm.vue
| | | | |-- settingAccountForm.vue
| | | | |-- verifyEmail.vue
| | | | |-- viewApplyGenForm.vue
| | | |-- js
| | | |-- request.ts
| | |-- settingPassword ----------------------用户设置账户密码页面
| | |-- index.vue
| | |-- component
| | | |-- settingPasswordForm.vue
| | |-- js
| | |-- request.ts
组件预览
安装依赖
npm install meixisetting
项目文件
/// index.ts
// 入口导出包含组件的路由信息,需在项目中在获取动态路由信息后添加至项目路由中
const init = (layout:any): RouterType => {
return [
{
path: '/setting',
name: 'setting',
component: layout,
redirect: '/setting/settingAccount',
meta: {
title: '设置中心',
icon: 'meixicomponenticon-yuansu',
noCache: false,
},
isShow: 0,
children: [
{
path: 'settingAccount',
component: settingAccount,
name: 'settingAccount',
isShow: 0,
meta: {
title: '设置账户',
icon: 'meixicomponenticon-CombinedShape-',
noCache: true,
},
},
{
path: 'settingPassword',
component: settingPassword,
name: 'settingPassword',
isShow: 0,
meta: {
title: '设置账户密码',
icon: 'meixicomponenticon-CombinedShape-',
noCache: true,
},
}
],
}
]
}
插件使用
//子系统中
//store ->permissionRouter.js 文件中
//引入插件
import meixilayout from 'meixilayout';
import { init } from 'meixisetting';
//第一个参数是meixilayout插件中导出的layout布局组件
//init(meixilayout.layout);
accessedRoutes = accessedRoutes.concat(init(meixilayout.layout));