mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[Doc] reduce config file (#412)
This commit is contained in:
parent
ffdb5c19c6
commit
b9576eee0d
@ -1,7 +1,9 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
const version = require('../../package.json').version;
|
import packageJson from '../../package.json';
|
||||||
|
import components from '../../example/config';
|
||||||
|
const { version } = packageJson;
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
header: {
|
header: {
|
||||||
logo: {
|
logo: {
|
||||||
image: 'https://img.yzcdn.cn/public_files/2017/12/18/fd78cf6bb5d12e2a119d0576bedfd230.png',
|
image: 'https://img.yzcdn.cn/public_files/2017/12/18/fd78cf6bb5d12e2a119d0576bedfd230.png',
|
||||||
@ -43,113 +45,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '组件',
|
name: '组件',
|
||||||
groups: [
|
groups: components
|
||||||
{
|
|
||||||
groupName: '基础组件',
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
path: '/col',
|
|
||||||
title: 'Layout 布局'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/badge',
|
|
||||||
title: 'Badge 徽章'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/button',
|
|
||||||
title: 'Button 按钮'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/cell',
|
|
||||||
title: 'Cell 单元格'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/icon',
|
|
||||||
title: 'Icon 图标'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/loading',
|
|
||||||
title: 'Loading 加载'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/nav-bar',
|
|
||||||
title: 'NavBar 导航栏'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/notice-bar',
|
|
||||||
title: 'NoticeBar 通告栏'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/panel',
|
|
||||||
title: 'Panel 面板'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/popup',
|
|
||||||
title: 'Popup 弹出层'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/steps',
|
|
||||||
title: 'Steps 步骤条'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/tag',
|
|
||||||
title: 'Tag 标记'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
groupName: '表单组件',
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
path: '/field',
|
|
||||||
title: 'Field 输入框'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/search',
|
|
||||||
title: 'Search 搜索'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/stepper',
|
|
||||||
title: 'Stepper 步进器'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/switch',
|
|
||||||
title: 'Switch 开关'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
groupName: '操作反馈',
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
path: '/actionsheet',
|
|
||||||
title: 'Actionsheet 上拉菜单'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/notify',
|
|
||||||
title: 'Notify 消息通知'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
groupName: '高阶组件',
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
path: '/tree-select',
|
|
||||||
title: 'TreeSelect 分类选择'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
groupName: '业务组件',
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
path: '/card',
|
|
||||||
title: 'Card 卡片'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
"pages/button/index",
|
"pages/button/index",
|
||||||
"pages/card/index",
|
"pages/card/index",
|
||||||
"pages/cell/index",
|
"pages/cell/index",
|
||||||
|
"pages/col/index",
|
||||||
"pages/field/index",
|
"pages/field/index",
|
||||||
"pages/icon/index",
|
"pages/icon/index",
|
||||||
"pages/layout/index",
|
|
||||||
"pages/loading/index",
|
"pages/loading/index",
|
||||||
"pages/nav-bar/index",
|
"pages/nav-bar/index",
|
||||||
"pages/notice-bar/index",
|
"pages/notice-bar/index",
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"pages/tree-select/index"
|
"pages/tree-select/index"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"navigationBarBackgroundColor": "#FAFAFA",
|
"navigationBarBackgroundColor": "#f8f8f8",
|
||||||
"navigationBarTitleText": "Vant Weapp",
|
"navigationBarTitleText": "Vant Weapp",
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
"backgroundTextStyle": "dark",
|
"backgroundTextStyle": "dark",
|
||||||
|
111
example/config.js
Normal file
111
example/config.js
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
export default [
|
||||||
|
{
|
||||||
|
groupName: '基础组件',
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
path: '/col',
|
||||||
|
title: 'Layout 布局'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/badge',
|
||||||
|
title: 'Badge 徽章'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/button',
|
||||||
|
title: 'Button 按钮'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/cell',
|
||||||
|
title: 'Cell 单元格'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/icon',
|
||||||
|
title: 'Icon 图标'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/loading',
|
||||||
|
title: 'Loading 加载'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/nav-bar',
|
||||||
|
title: 'NavBar 导航栏'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/notice-bar',
|
||||||
|
title: 'NoticeBar 通告栏'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/panel',
|
||||||
|
title: 'Panel 面板'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/popup',
|
||||||
|
title: 'Popup 弹出层'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/steps',
|
||||||
|
title: 'Steps 步骤条'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/tag',
|
||||||
|
title: 'Tag 标记'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupName: '表单组件',
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
path: '/field',
|
||||||
|
title: 'Field 输入框'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/search',
|
||||||
|
title: 'Search 搜索'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/stepper',
|
||||||
|
title: 'Stepper 步进器'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/switch',
|
||||||
|
title: 'Switch 开关'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupName: '操作反馈',
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
path: '/actionsheet',
|
||||||
|
title: 'Actionsheet 上拉菜单'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/notify',
|
||||||
|
title: 'Notify 消息通知'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/toast',
|
||||||
|
title: 'Toast 轻提示'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupName: '高阶组件',
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
path: '/tree-select',
|
||||||
|
title: 'TreeSelect 分类选择'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupName: '业务组件',
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
path: '/card',
|
||||||
|
title: 'Card 卡片'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
@ -1,107 +0,0 @@
|
|||||||
export default {
|
|
||||||
base: {
|
|
||||||
title: '基础组件',
|
|
||||||
content: [
|
|
||||||
{
|
|
||||||
name: 'Layout 布局',
|
|
||||||
path: '/pages/layout/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Badge 徽章',
|
|
||||||
path: '/pages/badge/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Button 按钮',
|
|
||||||
path: '/pages/button/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Cell 单元格',
|
|
||||||
path: '/pages/cell/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Icon 图标',
|
|
||||||
path: '/pages/icon/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Loading 加载',
|
|
||||||
path: '/pages/loading/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'NavBar 导航栏',
|
|
||||||
path: '/pages/nav-bar/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'NoticeBar 通告栏',
|
|
||||||
path: '/pages/notice-bar/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Panel 面板',
|
|
||||||
path: '/pages/panel/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Popup 弹出层',
|
|
||||||
path: '/pages/popup/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Steps 步骤条',
|
|
||||||
path: '/pages/steps/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tag 标记',
|
|
||||||
path: '/pages/tag/index'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
title: '表单',
|
|
||||||
content: [
|
|
||||||
{
|
|
||||||
name: 'Field 输入框',
|
|
||||||
path: '/pages/field/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Search 搜索',
|
|
||||||
path: '/pages/search/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Stepper 步进器',
|
|
||||||
path: '/pages/stepper/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Switch 开关',
|
|
||||||
path: '/pages/switch/index'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
action: {
|
|
||||||
title: '操作反馈',
|
|
||||||
content: [
|
|
||||||
{
|
|
||||||
name: 'Actionsheet 上拉菜单',
|
|
||||||
path: '/pages/actionsheet/index'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Notify 消息提示',
|
|
||||||
path: '/pages/notify/index'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
high: {
|
|
||||||
title: '高阶组件',
|
|
||||||
content: [
|
|
||||||
{
|
|
||||||
name: 'TresSelect 分类选择',
|
|
||||||
path: '/pages/tree-select/index'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
bussiness: {
|
|
||||||
title: '业务组件',
|
|
||||||
content: [
|
|
||||||
{
|
|
||||||
name: 'Card 卡片',
|
|
||||||
path: '/pages/card/index'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
@ -1,4 +1,4 @@
|
|||||||
import config from './config';
|
import config from '../../config';
|
||||||
import Page from '../../common/page';
|
import Page from '../../common/page';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
@ -7,15 +7,15 @@
|
|||||||
|
|
||||||
<block wx:for="{{ list }}" wx:for-item="group" wx:key="group.title">
|
<block wx:for="{{ list }}" wx:for-item="group" wx:key="group.title">
|
||||||
<view class="mobile-nav">
|
<view class="mobile-nav">
|
||||||
<view class="mobile-nav__title">{{ group.title }}</view>
|
<view class="mobile-nav__title">{{ group.groupName }}</view>
|
||||||
<van-cell-group>
|
<van-cell-group>
|
||||||
<van-cell
|
<van-cell
|
||||||
wx:for="{{ group.content }}"
|
wx:for="{{ group.list }}"
|
||||||
wx:key="name"
|
wx:key="item.title"
|
||||||
is-link
|
is-link
|
||||||
title-width="200px"
|
title-width="200px"
|
||||||
url="{{ item.path }}"
|
url="/pages{{ item.path }}/index"
|
||||||
title="{{ item.name }}"
|
title="{{ item.title }}"
|
||||||
></van-cell>
|
></van-cell>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
</view>
|
</view>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user