[new feature] Tab: add border prop
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`border props 1`] = `
|
||||
<div class="van-tabs van-tabs--line">
|
||||
<div class="van-tabs__wrap">
|
||||
<div class="van-tabs__nav van-tabs__nav--line">
|
||||
<div class="van-tabs__line"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="van-tabs__content"></div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`change tabs data 1`] = `
|
||||
<div class="van-tabs van-tabs--line">
|
||||
<div class="van-tabs__wrap van-hairline--top-bottom">
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import Vue from 'vue';
|
||||
import Tab from '..';
|
||||
import Tabs from '../../tabs';
|
||||
import { mount, later, triggerDrag } from '../../../test/utils';
|
||||
|
||||
Vue.use(Tab);
|
||||
Vue.use(Tabs);
|
||||
|
||||
function createWrapper(options = {}) {
|
||||
return mount({
|
||||
template: `
|
||||
<tabs
|
||||
<van-tabs
|
||||
:color="color"
|
||||
:type="type"
|
||||
:sticky="sticky"
|
||||
@@ -15,18 +19,14 @@ function createWrapper(options = {}) {
|
||||
@change="onChange"
|
||||
>
|
||||
${options.extraTemplate || ''}
|
||||
<tab :title="title1">Text</tab>
|
||||
<tab>
|
||||
<van-tab :title="title1">Text</van-tab>
|
||||
<van-tab>
|
||||
<span slot="title">title2</span>
|
||||
Text
|
||||
</tab>
|
||||
<tab title="title3" disabled>Text</tab>
|
||||
</tabs>
|
||||
</van-tab>
|
||||
<van-tab title="title3" disabled>Text</van-tab>
|
||||
</van-tabs>
|
||||
`,
|
||||
components: {
|
||||
Tab,
|
||||
Tabs
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title1: 'title1',
|
||||
@@ -127,3 +127,13 @@ test('render nav-left & nav-right slot', async () => {
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('border props', async () => {
|
||||
const wrapper = mount({
|
||||
template: `
|
||||
<van-tabs :border="false" />
|
||||
`,
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user