Skip to content

Commit

Permalink
fix(side-navbar): remove unnecessary props (#2858)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Jan 21, 2024
1 parent 6d1e6b9 commit 98093c5
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 63 deletions.
14 changes: 7 additions & 7 deletions src/packages/__VUE/sidenavbar/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { nextTick } from 'vue';

const template = `
<nut-side-navbar offset="30">
<nut-sub-side-navbar title="智能城市AI" ikey="6">
<nut-sub-side-navbar title="人体识别1" ikey="9" :open="false">
<nut-side-navbar-item ikey="10" title="人体检测1"></nut-side-navbar-item>
<nut-side-navbar-item ikey="11" title="细粒度人像分割1"></nut-side-navbar-item>
<nut-sub-side-navbar title="智能城市AI">
<nut-sub-side-navbar title="人体识别1" :open="false">
<nut-side-navbar-item title="人体检测1"></nut-side-navbar-item>
<nut-side-navbar-item title="细粒度人像分割1"></nut-side-navbar-item>
</nut-sub-side-navbar>
<nut-sub-side-navbar title="人体识别2" ikey="12">
<nut-side-navbar-item ikey="13" title="人体检测2"></nut-side-navbar-item>
<nut-side-navbar-item ikey="14" title="细粒度人像分割2"></nut-side-navbar-item>
<nut-sub-side-navbar title="人体识别2">
<nut-side-navbar-item title="人体检测2"></nut-side-navbar-item>
<nut-side-navbar-item title="细粒度人像分割2"></nut-side-navbar-item>
</nut-sub-side-navbar>
</nut-sub-side-navbar>
</nut-side-navbar>
Expand Down
2 changes: 0 additions & 2 deletions src/packages/__VUE/sidenavbar/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ app.use(SideNavbarItem);
| Attribute | Description | Type | Default |
| --- | --- | --- | --- |
| title | Navigation title | string | `` |
| ikey | Navigation unique identifier | number \| string | `` |
| open | Whether navigation is expanded by default | boolean | `true` |

### SideNavbarItem Props

| Attribute | Description | Type | Default |
| --- | --- | --- | --- |
| title | Navigation title | string | `15` |
| ikey | Navigation unique identifier | number \| string | `` |

### SubSideNavbar Events

Expand Down
2 changes: 0 additions & 2 deletions src/packages/__VUE/sidenavbar/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ app.use(SideNavbarItem);
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| title | 导航标题 | string | `` |
| ikey | 导航唯一标识 | number \| string | `` |
| open | 导航是否默认展开 | boolean | `true` |

### SideNavbarItem Props

| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| title | 导航标题 | string | `15` |
| ikey | 导航唯一标识 | number \| string | `` |

### SubSideNavbar Events

Expand Down
2 changes: 0 additions & 2 deletions src/packages/__VUE/sidenavbar/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ app.use(SideNavbarItem);
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| title | 导航标题 | string | `` |
| ikey | 导航唯一标识 | number \| string | `` |
| open | 导航是否默认展开 | boolean | `true` |

### SideNavbarItem Props

| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| title | 导航标题 | string | `15` |
| ikey | 导航唯一标识 | number \| string | `` |

### SubSideNavbar Events

Expand Down
1 change: 0 additions & 1 deletion src/packages/__VUE/sidenavbar/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.nut-side-navbar {
height: 100%;
overflow: auto;
display: block;
&__content {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/sidenavbar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default create({
const handleSlots = () => {
let childNodes = list.value.childNodes;
if (childNodes.length) {
if (childNodes?.length) {
childNodes = Array.from(childNodes)
.filter((item: any) => item.nodeType !== 3)
.map((item: any) => {
Expand Down
16 changes: 1 addition & 15 deletions src/packages/__VUE/sidenavbaritem/index.taro.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<view class="nut-side-navbar-item" :ikey="ikey" @click.stop="handleClick">
<view class="nut-side-navbar-item">
<span class="nut-side-navbar-item__title">
{{ title }}
</span>
Expand All @@ -13,21 +13,7 @@ export default create({
title: {
type: String,
default: ''
},
ikey: {
type: String,
default: ''
}
},
emits: ['click'],
setup: (props, { emit }) => {
const handleClick = () => {
emit('click');
};
return {
handleClick
};
}
});
</script>
16 changes: 1 addition & 15 deletions src/packages/__VUE/sidenavbaritem/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<view class="nut-side-navbar-item" :ikey="ikey" @click.stop="handleClick">
<view class="nut-side-navbar-item">
<span class="nut-side-navbar-item__title">
{{ title }}
</span>
Expand All @@ -13,21 +13,7 @@ export default create({
title: {
type: String,
default: ''
},
ikey: {
type: String,
default: ''
}
},
emits: ['click'],
setup: (props, { emit }) => {
const handleClick = () => {
emit('click');
};
return {
handleClick
};
}
});
</script>
6 changes: 0 additions & 6 deletions src/packages/__VUE/subsidenavbar/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
top: 50%;
right: 20px;
transform: translateY(-50%);
i {
transition: transform 0.5s ease-in-out;
&.up {
transform: rotate(-180deg);
}
}
}
}
&__list {
Expand Down
10 changes: 3 additions & 7 deletions src/packages/__VUE/subsidenavbar/index.taro.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<view class="nut-sub-side-navbar" :ikey="ikey">
<view class="nut-sub-side-navbar">
<view class="nut-sub-side-navbar__title" @click.stop="handleClick">
<span class="nut-sub-side-navbar__title__text">{{ title }}</span>
<span class="nut-sub-side-navbar__title__icon">
<ArrowDown2 v-if="!direction" size="12px"></ArrowDown2>
<ArrowUp2 v-else size="12px"></ArrowUp2>
<ArrowDown2 v-if="!direction" size="10"></ArrowDown2>
<ArrowUp2 v-else size="10"></ArrowUp2>
</span>
</view>
<view
Expand All @@ -28,10 +28,6 @@ export default create({
type: String,
default: ''
},
ikey: {
type: [String, Number],
default: ''
},
open: {
type: Boolean,
default: true
Expand Down
6 changes: 1 addition & 5 deletions src/packages/__VUE/subsidenavbar/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<view class="nut-sub-side-navbar" :ikey="ikey">
<view class="nut-sub-side-navbar">
<view class="nut-sub-side-navbar__title" @click.stop="handleClick">
<span class="nut-sub-side-navbar__title__text">{{ title }}</span>
<span class="nut-sub-side-navbar__title__icon">
Expand Down Expand Up @@ -28,10 +28,6 @@ export default create({
type: String,
default: ''
},
ikey: {
type: [String, Number],
default: ''
},
open: {
type: Boolean,
default: true
Expand Down

0 comments on commit 98093c5

Please sign in to comment.