mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-07-14 01:31:06 +08:00
Compare commits
7 Commits
b338aef41f
...
8bc55c8b32
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bc55c8b32 | ||
|
|
c7cc1342fc | ||
|
|
3e197222c1 | ||
|
|
acb4364c97 | ||
|
|
52ed563d46 | ||
|
|
1d69e73eda | ||
|
|
760fcbb424 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vant/area-data",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"description": "Vant 省市区数据",
|
||||
"main": "dist/index.cjs.js",
|
||||
"module": "dist/index.esm.js",
|
||||
|
||||
@ -509,15 +509,14 @@ export const areaList = {
|
||||
130471: '邯郸经济技术开发区',
|
||||
130473: '邯郸冀南新区',
|
||||
130481: '武安市',
|
||||
130502: '桥东区',
|
||||
130503: '桥西区',
|
||||
130521: '邢台县',
|
||||
130502: '襄都区',
|
||||
130503: '信都区',
|
||||
130505: '任泽区',
|
||||
130506: '南和区',
|
||||
130522: '临城县',
|
||||
130523: '内丘县',
|
||||
130524: '柏乡县',
|
||||
130525: '隆尧县',
|
||||
130526: '任县',
|
||||
130527: '南和县',
|
||||
130528: '宁晋县',
|
||||
130529: '巨鹿县',
|
||||
130530: '新河县',
|
||||
|
||||
@ -1281,9 +1281,9 @@ new-github-release-url@1.0.0:
|
||||
type-fest "^0.4.1"
|
||||
|
||||
node-fetch@^2.6.1:
|
||||
version "2.6.6"
|
||||
resolved "https://registry.npmmirror.com/node-fetch/download/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89"
|
||||
integrity sha1-F1GnwBg06OFpd1hzLp77burfr4k=
|
||||
version "2.6.7"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
|
||||
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
|
||||
dependencies:
|
||||
whatwg-url "^5.0.0"
|
||||
|
||||
@ -1794,7 +1794,7 @@ to-regex-range@^5.0.1:
|
||||
|
||||
tr46@~0.0.3:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.npmmirror.com/tr46/download/tr46-0.0.3.tgz?cache=0&sync_timestamp=1633303287861&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Ftr46%2Fdownload%2Ftr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
|
||||
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
|
||||
integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=
|
||||
|
||||
tslib@~2.1.0:
|
||||
@ -1887,12 +1887,12 @@ wcwidth@^1.0.1:
|
||||
|
||||
webidl-conversions@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.npmmirror.com/webidl-conversions/download/webidl-conversions-3.0.1.tgz?cache=0&sync_timestamp=1632753508689&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fwebidl-conversions%2Fdownload%2Fwebidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
||||
integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=
|
||||
|
||||
whatwg-url@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.npmmirror.com/whatwg-url/download/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
|
||||
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
|
||||
integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0=
|
||||
dependencies:
|
||||
tr46 "~0.0.3"
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## v1.3.5
|
||||
|
||||
- Fix useChildren missing subTree when flattening vnodes
|
||||
|
||||
## v1.3.4
|
||||
|
||||
- Fix useClickAway failed in SSR
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vant/use",
|
||||
"version": "1.3.4",
|
||||
"version": "1.3.5",
|
||||
"description": "Vant Composition API",
|
||||
"main": "dist/index.cjs.js",
|
||||
"module": "dist/index.esm.js",
|
||||
|
||||
@ -20,6 +20,7 @@ export function flattenVNodes(children: VNodeNormalizedChildren) {
|
||||
result.push(child);
|
||||
|
||||
if (child.component?.subTree) {
|
||||
result.push(child.component.subTree);
|
||||
traverse(child.component.subTree.children);
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ exports[`should render Tab inside a component correctly 1`] = `
|
||||
aria-controls="van-tab"
|
||||
>
|
||||
<span class="van-tab__text van-tab__text--ellipsis">
|
||||
2
|
||||
1
|
||||
</span>
|
||||
</div>
|
||||
<div id="van-tabs-1"
|
||||
@ -26,7 +26,7 @@ exports[`should render Tab inside a component correctly 1`] = `
|
||||
aria-controls="van-tab"
|
||||
>
|
||||
<span class="van-tab__text van-tab__text--ellipsis">
|
||||
1
|
||||
2
|
||||
</span>
|
||||
</div>
|
||||
<div id="van-tabs-2"
|
||||
@ -47,15 +47,6 @@ exports[`should render Tab inside a component correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<div class="van-tabs__content">
|
||||
<div id="van-tab"
|
||||
role="tabpanel"
|
||||
class="van-tab__panel"
|
||||
tabindex="0"
|
||||
aria-labelledby="van-tabs-1"
|
||||
style
|
||||
>
|
||||
1
|
||||
</div>
|
||||
<div id="van-tab"
|
||||
role="tabpanel"
|
||||
class="van-tab__panel"
|
||||
@ -64,6 +55,15 @@ exports[`should render Tab inside a component correctly 1`] = `
|
||||
style="display: none;"
|
||||
>
|
||||
</div>
|
||||
<div id="van-tab"
|
||||
role="tabpanel"
|
||||
class="van-tab__panel"
|
||||
tabindex="0"
|
||||
aria-labelledby="van-tabs-1"
|
||||
style
|
||||
>
|
||||
2
|
||||
</div>
|
||||
<div id="van-tab"
|
||||
role="tabpanel"
|
||||
class="van-tab__panel"
|
||||
|
||||
@ -112,9 +112,10 @@ export default defineComponent({
|
||||
|
||||
const onSidebarChange = (index: number) => {
|
||||
emit('update:mainActiveIndex', index);
|
||||
emit('click-nav', index);
|
||||
};
|
||||
|
||||
const onClickSidebarItem = (index: number) => emit('click-nav', index);
|
||||
|
||||
const renderSidebar = () => {
|
||||
const Items = props.items.map((item) => (
|
||||
<SidebarItem
|
||||
@ -123,6 +124,7 @@ export default defineComponent({
|
||||
badge={item.badge}
|
||||
class={[bem('nav-item'), item.className]}
|
||||
disabled={item.disabled}
|
||||
onClick={onClickSidebarItem}
|
||||
/>
|
||||
));
|
||||
|
||||
|
||||
@ -26,7 +26,23 @@ test('should render empty TreeSelect correctly', () => {
|
||||
expect(mount(TreeSelect).html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should emit click-nav event when nav item is clicked', () => {
|
||||
test('should emit update:mainActiveIndex event when mainActiveIndex is changed', async () => {
|
||||
const wrapper = mount(TreeSelect, {
|
||||
props: {
|
||||
items: mockItems,
|
||||
mainActiveIndex: 0,
|
||||
},
|
||||
});
|
||||
|
||||
const navItems = wrapper.findAll('.van-tree-select__nav-item');
|
||||
await navItems[0].trigger('click');
|
||||
expect(wrapper.emitted('update:mainActiveIndex')).toBeFalsy();
|
||||
|
||||
await navItems[1].trigger('click');
|
||||
expect(wrapper.emitted('update:mainActiveIndex')?.[0]).toEqual([1]);
|
||||
});
|
||||
|
||||
test('should emit click-nav event when nav item is clicked', async () => {
|
||||
const wrapper = mount(TreeSelect, {
|
||||
props: {
|
||||
items: mockItems,
|
||||
@ -34,9 +50,10 @@ test('should emit click-nav event when nav item is clicked', () => {
|
||||
});
|
||||
|
||||
const navItems = wrapper.findAll('.van-tree-select__nav-item');
|
||||
navItems[1].trigger('click');
|
||||
expect(wrapper.emitted('update:mainActiveIndex')?.[0]).toEqual([1]);
|
||||
expect(wrapper.emitted('click-nav')?.[0]).toEqual([1]);
|
||||
await navItems[0].trigger('click');
|
||||
expect(wrapper.emitted('click-nav')?.[0]).toEqual([0]);
|
||||
await navItems[0].trigger('click');
|
||||
expect(wrapper.emitted('click-nav')?.[1]).toEqual([0]);
|
||||
});
|
||||
|
||||
test('should emit click-item event when item is clicked', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user