chore: small fixes

This commit is contained in:
07akioni 2020-02-29 14:55:52 +08:00
parent 0613160ecb
commit f424260f3b
15 changed files with 89 additions and 72 deletions

View File

@ -20,12 +20,12 @@ use-component
|Name|Type|Default|Description|
|-|-|-|-|
|type|`'error \| 'success' \| 'warning'`|`'warning'`||
|title|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be a render function.|
|title|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be a render function.|
|closable|`boolean`|`boolean`||
|icon|`(function:() => VNode\|Array<VNode>)`|`null`|Should be a render function.|
|icon|`() => VNode \| Array<VNode>`|`null`|Should be a render function.|
|negative-text|`string`|`null`|Corresponding button won't show if not set.|
|positive-text|`string`|`null`|Corresponding button won't show if not set.|
|content|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be a render function.|
|content|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be a render function.|
|show-icon|`boolean`|`true`||
|loading|`boolean`|`false`||
|bordered|`boolean`|`false`||
@ -40,12 +40,12 @@ Properties of ConfirmEnvironment can be modified
|Name|Type|Description|
|-|-|-|
|type|`'error \| 'success' \| 'warning'`||
|title|`string \| (function:() => VNode\|Array<VNode>)`|Can be a render function.|
|title|`string \| (() => VNode \| Array<VNode>)`|Can be a render function.|
|closable|`boolean`||
|icon|`(function:() => VNode\|Array<VNode>)`|Should be a render function.|
|icon|`() => VNode \| Array<VNode>`|Should be a render function.|
|negative-text|`string`|Corresponding button won't show if not set.|
|positive-text|`string`|Corresponding button won't show if not set.|
|content|`string \| (function:() => VNode\|Array<VNode>)`|Can be a render function.|
|content|`string \| (() => VNode \| Array<VNode>)`|Can be a render function.|
|show-icon|`boolean`||
|loading|`boolean`||
|bordered|`boolean`||
@ -63,12 +63,12 @@ Properties of ConfirmEnvironment can be modified
|Name|Type|Default|Description|
|-|-|-|-|
|type|`'error \| 'success' \| 'warning'`|`'warning'`||
|title|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be a render function.|
|title|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be a render function.|
|closable|`boolean`|`boolean`||
|icon|`(function:() => VNode\|Array<VNode>)`|`null`|Should be a render function|
|icon|`() => VNode \| Array<VNode>`|`null`|Should be a render function|
|negative-text|`string`|`null`|Corresponding button won't show if not set.|
|positive-text|`string`|`null`|Corresponding button won't show if not set.|
|content|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be a render function.|
|content|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be a render function.|
|show-icon|`boolean`|`true`||
|loading|`boolean`|`false`||
|bordered|`boolean`|`false`||

View File

@ -20,12 +20,12 @@ use-component
|名称|类型|默认值|说明|
|-|-|-|-|
|type|`'error \| 'success' \| 'warning'`|`'warning'`||
|title|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是 render 函数|
|title|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是 render 函数|
|closable|`boolean`|`boolean`||
|icon|`(function:() => VNode\|Array<VNode>)`|`null`|需要是 render 函数|
|icon|`() => VNode \| Array<VNode>`|`null`|需要是 render 函数|
|negative-text|`string`|`null`|不填对应的按钮不会出现|
|positive-text|`string`|`null`|不填对应的按钮不会出现|
|content|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是 render 函数|
|content|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是 render 函数|
|show-icon|`boolean`|`true`||
|loading|`boolean`|`false`||
|bordered|`boolean`|`false`||
@ -40,12 +40,12 @@ use-component
|名称|类型|说明|
|-|-|-|
|type|`'error \| 'success' \| 'warning'`||
|title|`string \| (function:() => VNode\|Array<VNode>)`|可以是 render 函数|
|title|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数|
|closable|`boolean`||
|icon|`(function:() => VNode\|Array<VNode>)`|需要是 render 函数|
|icon|`() => VNode \| Array<VNode>`|需要是 render 函数|
|negative-text|`string`|不填对应的按钮不会出现|
|positive-text|`string`|不填对应的按钮不会出现|
|content|`string \| (function:() => VNode\|Array<VNode>)`|可以是 render 函数|
|content|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数|
|show-icon|`boolean`||
|loading|`boolean`||
|bordered|`boolean`||
@ -63,12 +63,12 @@ use-component
|名称|类型|默认值|说明|
|-|-|-|-|
|type|`'error \| 'success' \| 'warning'`|`'warning'`||
|title|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是 render 函数|
|title|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是 render 函数|
|closable|`boolean`|`boolean`||
|icon|`(function:() => VNode\|Array<VNode>)`|`null`|需要是 render 函数|
|icon|`() => VNode \| Array<VNode>`|`null`|需要是 render 函数|
|negative-text|`string`|`null`|不填对应的按钮不会出现|
|positive-text|`string`|`null`|不填对应的按钮不会出现|
|content|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是 render 函数|
|content|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是 render 函数|
|show-icon|`boolean`|`true`||
|loading|`boolean`|`false`||
|bordered|`boolean`|`false`||

View File

@ -77,7 +77,7 @@ These methods can help you control table in an uncontrolled manner. However, it'
|align|`'left' \| 'right' \| 'center'`|`'left'`|Text align in column|
|ellipsis|`boolean`|`false`||
|className|`string`|`null`||
|title|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be a render function|
|title|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be a render function|
|key|`string`||Unique key of this column, **required** when table's row-key is not set.|
|sorter|`boolean \| function \| 'default'`|`false`|The sorter of the column. If set `'default'`, it will use a basic builtin compare function. If set to `true`, it will only display sort icon on the column, which can be used in async status. Otherwise it works like `Array.sort`'s compare function.|
|defaultSortOrder|`'descend' \| 'ascend' \| false`|`false`|The default sort order of the table in uncontrolled manner|

View File

@ -77,7 +77,7 @@ ajaxUsage
|align|`'left' \| 'right' \| 'center'`|`'left'`|列内的文本排列|
|ellipsis|`boolean`|`false`||
|className|`string`|`null`||
|title|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是渲染函数|
|title|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是渲染函数|
|key|`string`||这一列的 key在表格未设定 row-key 的时候是**必须**的。|
|sorter|`boolean \| function \| 'default'`|`false`|这一列的排序方法。如果设为 `'default'` 表格将会使用一个内置的排序函数;如果设为 `true`,表格将只会在这列展示一个排序图标,在异步的时候可能有用。其他情况下它工作的方式类似 `Array.sort` 的对比函数|
|defaultSortOrder|`'descend' \| 'ascend' \| false`|`false`|非受控状态下表格默认的排序方式|

View File

@ -23,8 +23,8 @@ about-theme
### MessageOption Type
|Name|Type|Description|
|-|-|-|
|content|`string \|(function:() => VNode\|Array<VNode>)`|Can be a render function|
|icon|`string \| (function:() => VNode)`|Can be a render function|
|content|`string \|(() => VNode \| Array<VNode>)`|Can be a render function|
|icon|`string \| (() => VNode)`|Can be a render function|
|onHide|`function`||
|onAfterHide|`function`||
@ -32,8 +32,8 @@ about-theme
#### MessageEnvironment Properties
|Name|Type|Description|
|-|-|-|
|content|`string \| (function:() => VNode\|Array<VNode>)`|Can be a render function|
|icon|`string \| (function:() => VNode)`|Can be a render function|
|content|`string \| (() => VNode \| Array<VNode>)`|Can be a render function|
|icon|`string \| (() => VNode)`|Can be a render function|
|type|`'info' \| 'success' \| 'warning' \| 'error' \| 'loading'`||
|onHide|`function`||
|onAfterHide|`function`||

View File

@ -23,8 +23,8 @@ about-theme
### MessageOption Type
|名称|类型|说明|
|-|-|-|
|content|`string \| (function:() => VNode\|Array<VNode>)`|可以是 render 函数|
|icon|`string \| (function:() => VNode)`|可以是 render 函数|
|content|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数|
|icon|`string \| (() => VNode)`|可以是 render 函数|
|onHide|`function`||
|onAfterHide|`function`||
@ -32,8 +32,8 @@ about-theme
#### MessageEnvironment Properties
|名称|类型|说明|
|-|-|-|
|content|`string \| (function:() => VNode\|Array<VNode>)`|可以是 render 函数n|
|icon|`string \| (function:() => VNode)`|可以是 render 函数|
|content|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数n|
|icon|`string \| (() => VNode)`|可以是 render 函数|
|type|`'info' \| 'success' \| 'warning' \| 'error' \| 'loading'`||
|onHide|`function`||
|onAfterHide|`function`||

View File

@ -29,12 +29,12 @@ duration
### NotificationOption Type
|Name|Type|Default|Description|
|-|-|-|-|
|avatar|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be render function|
|title|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be render function|
|description|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be render function|
|content|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be render function|
|meta|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be render function|
|action|`string \| (function:() => VNode\|Array<VNode>)`|`null`|Can be render function|
|avatar|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be render function|
|title|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be render function|
|description|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be render function|
|content|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be render function|
|meta|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be render function|
|action|`string \| (() => VNode \| Array<VNode>)`|`null`|Can be render function|
|closable|`boolean`|`true`||
|onClose|`(next: function) => any`|`next => next()`|Only if next is called notification will close.|
|onAfterHide|`function`|`null`||
@ -47,12 +47,12 @@ Properties of NofiticationEnvironment Instance can be dynamically set.
|Name|Type|Description|
|-|-|-|
|avatar|`string \| (function:() => VNode\|Array<VNode>)`|Can be render function|
|title|`string \| (function:() => VNode\|Array<VNode>)`|Can be render function|
|description|`string \| (function:() => VNode\|Array<VNode>)`|Can be render function|
|content|`string \| (function:() => VNode\|Array<VNode>)`|Can be render function|
|meta|`string \| (function:() => VNode\|Array<VNode>)`|Can be render function|
|action|`string \| (function:() => VNode\|Array<VNode>)`|Can be render function|
|avatar|`string \| (() => VNode \| Array<VNode>)`|Can be render function|
|title|`string \| (() => VNode \| Array<VNode>)`|Can be render function|
|description|`string \| (() => VNode \| Array<VNode>)`|Can be render function|
|content|`string \| (() => VNode \| Array<VNode>)`|Can be render function|
|meta|`string \| (() => VNode \| Array<VNode>)`|Can be render function|
|action|`string \| (() => VNode \| Array<VNode>)`|Can be render function|
|closable|`boolean`||
|onClose|`(next: function) => any`|Callback when close button is clicked. Only if next is called notification will close|
|onHide|`function`||

View File

@ -33,12 +33,12 @@ duration
|名称|类型|默认值|说明|
|-|-|-|-|
|avatar|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是 render 函数|
|title|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是 render 函数|
|description|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是 render 函数|
|content|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是 render 函数|
|meta|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是 render 函数|
|action|`string \| (function:() => VNode\|Array<VNode>)`|`null`|可以是 render 函数|
|avatar|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是 render 函数|
|title|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是 render 函数|
|description|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是 render 函数|
|content|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是 render 函数|
|meta|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是 render 函数|
|action|`string \| (() => VNode \| Array<VNode>)`|`null`|可以是 render 函数|
|closable|`boolean`|`true`||
|onClose|`(next: function) => any`|`next => next()`|只有调用了 next 通知才会被关闭|
|onAfterHide|`function`|`null`||
@ -51,12 +51,12 @@ NofiticationEnvironment 实例的属性可以被动态改变。
|名称|类型|说明|
|-|-|-|
|avatar|`string \| (function:() => VNode\|Array<VNode>)`|可以是 render 函数|
|title|`string \| (function:() => VNode\|Array<VNode>)`|可以是 render 函数|
|description|`string \| (function:() => VNode\|Array<VNode>)`|可以是 render 函数|
|content|`string \| (function:() => VNode\|Array<VNode>)`|可以是 render 函数|
|meta|`string \| (function:() => VNode\|Array<VNode>)`|可以是 render 函数|
|action|`string \| (function:() => VNode\|Array<VNode>)`|可以是 render 函数|
|avatar|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数|
|title|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数|
|description|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数|
|content|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数|
|meta|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数|
|action|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数|
|closable|`boolean`||
|onClose|`(next: function) => any`|点击了关闭按钮的回调。只有调用了 next 通知才会被关闭|
|onHide|`function`||

View File

@ -43,9 +43,9 @@ filter
## Events
|Name|Parameters|Description|
|-|-|-|
|selected-keys-change|`(Array<string \| number>`)||
|expanded-keys-change|`(Array<string \| number>`)||
|checked-keys-change|`(Array<string \| number>`)||
|selected-keys-change|`(Array<string \| number>)`||
|expanded-keys-change|`(Array<string \| number>)`||
|checked-keys-change|`(Array<string \| number>)`||
|dragstart|`({ node: TreeNode, event: DragEvent })`||
|dragend|`({ node: TreeNode, event: DragEvent })`||
|dragenter|`({ node: TreeNode, event: DragEvent })`||

View File

@ -42,9 +42,9 @@ filter
## Events
|名称|参数|说明|
|-|-|-|
|selected-keys-change|`(Array<string \| number>`)||
|expanded-keys-change|`(Array<string \| number>`)||
|checked-keys-change|`(Array<string \| number>`)||
|selected-keys-change|`(Array<string \| number>)`||
|expanded-keys-change|`(Array<string \| number>)`||
|checked-keys-change|`(Array<string \| number>)`||
|dragstart|`({ node: TreeNode, event: DragEvent })`||
|dragend|`({ node: TreeNode, event: DragEvent })`||
|dragenter|`({ node: TreeNode, event: DragEvent })`||

View File

@ -27,7 +27,10 @@
style="margin-top: 0;"
class="naive-title"
>
Naive UI
<span
@mouseenter="handleTitleMouseEnter"
@mouseleave="handleTitleMouseLeave"
>Na{{ hover ? 'ï' : 'i' }}ve UI</span>
</n-h1>
<n-p style="font-size: 16px; margin-bottom: 0;">
{{ $t("intro1") }}
@ -58,11 +61,22 @@ export default {
leftImage,
rightImage
},
data () {
return {
hover: false
}
},
methods: {
handleStartClick () {
this.$router.push(
/^(\/[^/]+){2}/.exec(this.$route.path)[0] + '/doc/start'
)
},
handleTitleMouseEnter () {
this.hover = true
},
handleTitleMouseLeave () {
this.hover = false
}
}
}

View File

@ -5,14 +5,16 @@
"light": "浅色",
"searchPlaceholder": "搜索组件",
"home": "首页",
"doc": "文档"
"doc": "文档",
"alreadyHome": "别点了,你已经在首页了"
},
"en-US": {
"dark": "Dark",
"light": "Light",
"searchPlaceholder": "Search Components",
"home": "Home",
"doc": "Documentation"
"doc": "Documentation",
"alreadyHome": "You've already been in home page. No clicking."
}
}
</i18n>
@ -138,6 +140,10 @@ export default {
},
methods: {
handleLogoClick () {
if (/^(\/[^/]+){2}$/.test(this.$route.path)) {
this.$NMessage.info(this.$t('alreadyHome'))
return
}
this.$router.push(
/^(\/[^/]+){2}/.exec(this.$route.path)[0]
)

View File

@ -527,12 +527,6 @@ export default {
handleTableMainBodyScroll (e) {
this.handleTableBodyScroll(e, 'main')
},
handleTableLeftBodyScroll (e) {
this.handleTableBodyScroll(e, 'left')
},
handleTableRightBodyScroll (e) {
this.handleTableBodyScroll(e, 'right')
},
handleTableBodyScroll (e, part) {
if (!this.scrollingPart || this.scrollingPart === part) {
if (this.scrollingPart !== part) this.scrollingPart = part
@ -596,7 +590,6 @@ export default {
},
collectDOMSizes () {
const {
header: headerEl,
body: mainTableScrollContainer
} = this.getScrollElements()
this.mainTableScrollContainerWidth = mainTableScrollContainer.offsetWidth

View File

@ -93,7 +93,7 @@
vertical-align: bottom;
padding: 0 6px;
cursor: pointer;
border-radius: 3px;
border-radius: $--n-tree-node-border-radius;
text-decoration-color: transparent;
text-decoration-line: underline;
transition:

View File

@ -7,7 +7,8 @@ $--n-ease-in-out-cubic-bezier: cubic-bezier(.4, 0, .2, 1);
$--n-ease-out-cubic-bezier: cubic-bezier(0, 0, .2, 1);
$--n-ease-in-cubic-bezier: cubic-bezier(.4, 0, 1, 1);
$--n-border-radius: 4px;
$--n-border-radius: 3px;
$--n-light-border-radius: 2px;
$--n-height: (
"tiny": 22px,
@ -180,7 +181,7 @@ $--n-tabs-tab-font-size: (
);
/** tag */
$--n-tag-border-radius: 3px;
$--n-tag-border-radius: $--n-light-border-radius;
/** timeline */
$--n-timeline-header-font-size: (
@ -202,8 +203,11 @@ $--n-tooltip-border-radius: $--n-border-radius;
/** transfer */
$--n-transfer-border-radius: $--n-border-radius;
/** tree */
$--n-tree-node-border-radius: $--n-light-border-radius;
/** typography */
$--n-typography-code-border-radius: 3px;
$--n-typography-code-border-radius: $--n-light-border-radius;
$--n-typography-header-font-size: (
'1': 28px,
'2': 24px,