Merge branch 'dev' into next

This commit is contained in:
chenjiahan 2020-09-10 17:35:33 +08:00
commit ad5980c914
6 changed files with 62 additions and 5 deletions

Binary file not shown.

View File

@ -7,7 +7,7 @@ body {
color: @van-doc-black;
font-size: 16px;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
Segoe UI, Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB',
Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB',
'Microsoft Yahei', sans-serif;
background-color: @van-doc-background-color;
-webkit-font-smoothing: antialiased;

View File

@ -113,13 +113,13 @@ export default createComponent({
if (extraKeys.length === 1) {
keys.push(
{ text: 0, wider: true },
{ text: extraKey[0], type: 'extra' }
{ text: extraKeys[0], type: 'extra' }
);
} else if (extraKeys.length === 2) {
keys.push(
{ text: extraKey[0], type: 'extra' },
{ text: extraKeys[0], type: 'extra' },
{ text: 0 },
{ text: extraKey[1], type: 'extra' }
{ text: extraKeys[1], type: 'extra' }
);
}

View File

@ -1,5 +1,52 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`extra-key prop 1`] = `
<div class="van-number-keyboard" style="display: none;" name="van-slide-up">
<div class="van-number-keyboard__body">
<div class="van-number-keyboard__keys">
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">1</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">2</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">3</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">4</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">5</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">6</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">7</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">8</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">9</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">foo</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key">0</div>
</div>
<div class="van-key__wrapper">
<div role="button" tabindex="0" class="van-key van-key--delete"><svg viewBox="0 0 32 22" xmlns="http://www.w3.org/2000/svg" class="van-key__delete-icon">
<path d="M28.016 0A3.991 3.991 0 0132 3.987v14.026c0 2.2-1.787 3.987-3.98 3.987H10.382c-.509 0-.996-.206-1.374-.585L.89 13.09C.33 12.62 0 11.84 0 11.006c0-.86.325-1.62.887-2.08L9.01.585A1.936 1.936 0 0110.383 0zm0 1.947H10.368L2.24 10.28c-.224.226-.312.432-.312.73 0 .287.094.51.312.729l8.128 8.333h17.648a2.041 2.041 0 002.037-2.04V3.987c0-1.127-.915-2.04-2.037-2.04zM23.028 6a.96.96 0 01.678.292.95.95 0 01-.003 1.377l-3.342 3.348 3.326 3.333c.189.188.292.43.292.679 0 .248-.103.49-.292.679a.96.96 0 01-.678.292.959.959 0 01-.677-.292L18.99 12.36l-3.343 3.345a.96.96 0 01-.677.292.96.96 0 01-.678-.292.962.962 0 01-.292-.68c0-.248.104-.49.292-.679l3.342-3.348-3.342-3.348A.963.963 0 0114 6.971c0-.248.104-.49.292-.679A.96.96 0 0114.97 6a.96.96 0 01.677.292l3.358 3.348 3.345-3.348A.96.96 0 0123.028 6z" fill="currentColor"></path>
</svg></div>
</div>
</div>
</div>
</div>
`;
exports[`extra-key slot 1`] = `
<div class="van-number-keyboard" style="display: none;" name="van-slide-up">
<div class="van-number-keyboard__body">

View File

@ -93,6 +93,16 @@ test('title-left slot', () => {
expect(wrapper).toMatchSnapshot();
});
test('extra-key prop', () => {
const wrapper = mount(NumberKeyboard, {
propsData: {
extraKey: 'foo',
},
});
expect(wrapper).toMatchSnapshot();
});
test('extra-key slot', () => {
const wrapper = mount(NumberKeyboard, {
scopedSlots: {

View File

@ -48,7 +48,7 @@
@line-height-md: 20px;
@line-height-lg: 22px;
@base-font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB',
Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB',
'Microsoft Yahei', sans-serif;
@price-integer-font-family: Avenir-Heavy, PingFang SC, Helvetica Neue, Arial,
sans-serif;