Merge pull request #594 from TuSimple/main

This commit is contained in:
Yugang Cao 2021-07-22 22:57:57 +08:00 committed by GitHub
commit 73d0fd20ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 17 deletions

View File

@ -8,6 +8,7 @@
- `n-dropdown` add `render-icon` prop.
- `n-checkbox-group` add `min` and `max` prop.
- `n-mention` add `empty` slot.
- `n-space` `justify` prop supports `center`, `space-around` and `space-between`.
### Fixes

View File

@ -8,6 +8,7 @@
- `n-dropdown` 新增 `render-icon` 属性
- `n-checkbox-group` 新增 `min``max` 属性
- `n-mention` 新增 `empty` slot
- `n-space` `justify` 属性支持 `center`、`space-around` 和 `space-between`
### Fixes

View File

@ -51,13 +51,14 @@ describe('n-dialog', () => {
expect(wrapper.find('button').exists()).toEqual(false)
})
it('async', async () => {
it('loading', async () => {
const Test = defineComponent({
setup () {
const dialog = useDialog()
dialog.success({
title: 'Async',
title: 'Loading',
content: 'Content',
positiveText: '确认',
loading: true
})
},

View File

@ -1,9 +1,7 @@
# Space Between
In a way, `size` doesn't work on the main axis.
```html
<n-space justify="space-between" :size="[50, 10]">
<n-space justify="space-between">
<n-button>Oops!</n-button>
<n-button>Oops!</n-button>
<n-button>Oops!</n-button>

View File

@ -1,9 +1,7 @@
# 间隙
从某种以上来说, `size` 在主轴并没有用。
```html
<n-space justify="space-between" :size="[50, 10]">
<n-space justify="space-between">
<n-button>Oops!</n-button>
<n-button>Oops!</n-button>
<n-button>Oops!</n-button>

View File

@ -110,7 +110,6 @@ export default defineComponent({
? 'flex-' + justify
: justify,
flexWrap: !wrap || vertical ? 'nowrap' : 'wrap',
justifyContent: 'flex-' + justify,
marginTop: vertical ? '' : `-${semiVerticalMargin}`,
marginBottom: vertical ? '' : `-${semiVerticalMargin}`,
alignItems: align

View File

@ -1,15 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`n-space render custom style space 1`] = `
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; margin-top: -4px; margin-bottom: -4px;\\">
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -4px; margin-bottom: -4px;\\">
<div role=\\"none\\" style=\\"background-color: red; color: yellow; max-width: 100%; padding-top: 4px; padding-bottom: 4px;\\">div</div>
</div>"
`;
exports[`n-space render empty children 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; margin-top: -4px; margin-bottom: -4px;\\"></div>"`;
exports[`n-space render empty children 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -4px; margin-bottom: -4px;\\"></div>"`;
exports[`n-space render justify space 1`] = `
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; margin-top: -4px; margin-bottom: -4px;\\">
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -4px; margin-bottom: -4px;\\">
<div role=\\"none\\" style=\\"max-width: 100%; margin-right: 12px; padding-top: 4px; padding-bottom: 4px;\\">
<div>1</div>
</div>
@ -20,7 +20,7 @@ exports[`n-space render justify space 1`] = `
`;
exports[`n-space render justify space 2`] = `
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; margin-top: -4px; margin-bottom: -4px;\\">
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-end; flex-wrap: wrap; margin-top: -4px; margin-bottom: -4px;\\">
<div role=\\"none\\" style=\\"max-width: 100%; margin-right: 12px; padding-top: 4px; padding-bottom: 4px;\\">
<div>1</div>
</div>
@ -30,12 +30,12 @@ exports[`n-space render justify space 2`] = `
</div>"
`;
exports[`n-space render space number size 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; margin-top: -10px; margin-bottom: -10px;\\"></div>"`;
exports[`n-space render space number size 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -10px; margin-bottom: -10px;\\"></div>"`;
exports[`n-space render space string size 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; margin-top: -6px; margin-bottom: -6px;\\"></div>"`;
exports[`n-space render space string size 1`] = `"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -6px; margin-bottom: -6px;\\"></div>"`;
exports[`n-space render vertical space 1`] = `
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start;\\">
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: column; justify-content: flex-start; flex-wrap: nowrap;\\">
<div role=\\"none\\" style=\\"max-width: 100%; margin-bottom: 8px;\\">
<div>1</div>
</div>
@ -46,7 +46,7 @@ exports[`n-space render vertical space 1`] = `
`;
exports[`n-space should render with invalidElement 1`] = `
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; margin-top: -4px; margin-bottom: -4px;\\">
"<div role=\\"none\\" class=\\"n-space\\" style=\\"display: flex; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: -4px; margin-bottom: -4px;\\">
<div role=\\"none\\" style=\\"max-width: 100%; margin-right: 12px; padding-top: 4px; padding-bottom: 4px;\\">text1</div>
<div role=\\"none\\" style=\\"max-width: 100%; margin-right: 12px; padding-top: 4px; padding-bottom: 4px;\\"><span>text1</span></div>
<div role=\\"none\\" style=\\"max-width: 100%; padding-top: 4px; padding-bottom: 4px;\\">text1</div>