bug fix and performance improvements
This commit is contained in:
27
miniprogram/custom-tab-bar/data.ts
Normal file
27
miniprogram/custom-tab-bar/data.ts
Normal file
@ -0,0 +1,27 @@
|
||||
export default [
|
||||
{
|
||||
icon: 'home',
|
||||
label: '首页',
|
||||
url: 'pages/home/home',
|
||||
},
|
||||
{
|
||||
icon: 'card',
|
||||
label: '分类',
|
||||
url: 'pages/goods/category/index',
|
||||
},
|
||||
{
|
||||
icon: 'home',
|
||||
label: '购物车',
|
||||
url: 'pages/cart/index',
|
||||
},
|
||||
{
|
||||
icon: 'cart',
|
||||
label: '个人中心',
|
||||
url: 'pages/usercenter/index',
|
||||
},
|
||||
];
|
||||
export const adminTabMenu = [{
|
||||
icon:"person",
|
||||
label:"fd",
|
||||
url:"pages/usercenter/index"
|
||||
}]
|
8
miniprogram/custom-tab-bar/index.json
Normal file
8
miniprogram/custom-tab-bar/index.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar",
|
||||
"t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item",
|
||||
"t-icon": "tdesign-miniprogram/icon/icon"
|
||||
}
|
||||
}
|
1
miniprogram/custom-tab-bar/index.scss
Normal file
1
miniprogram/custom-tab-bar/index.scss
Normal file
@ -0,0 +1 @@
|
||||
/* custom-tab-bar/index.wxss */
|
30
miniprogram/custom-tab-bar/index.ts
Normal file
30
miniprogram/custom-tab-bar/index.ts
Normal file
@ -0,0 +1,30 @@
|
||||
// custom-tab-bar/index.ts
|
||||
import TabMenu from './data';
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
active: 0,
|
||||
list: TabMenu
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onChange(e: any) {
|
||||
console.log(e);
|
||||
// setData({
|
||||
// active:
|
||||
// })
|
||||
}
|
||||
}
|
||||
})
|
6
miniprogram/custom-tab-bar/index.wxml
Normal file
6
miniprogram/custom-tab-bar/index.wxml
Normal file
@ -0,0 +1,6 @@
|
||||
<!--custom-tab-bar/index.wxml-->
|
||||
<t-tab-bar value="{{active}}" bindchange="onChange" shape="round" theme="tag" split="{{false}}">
|
||||
<t-tab-bar-item wx:for="{{list}}" wx:key="index" icon="{{item.icon}}" ariaLabel="{{item.ariaLabel}}">
|
||||
{{item.label}}
|
||||
</t-tab-bar-item>
|
||||
</t-tab-bar>
|
Reference in New Issue
Block a user