doc(drawer): props doc with some fixes

This commit is contained in:
07akioni 2020-03-12 11:13:29 +08:00
parent c600e66d99
commit 9dd1a4dbf9
6 changed files with 25 additions and 8 deletions

View File

@ -13,12 +13,15 @@ multiple
## Props
|Name|Parameters|Default|Description|
|-|-|-|-|
|theme|`'light' \| 'dark'`|`null`||
|themed-style|`{ [themeName: string]: object }`|`null`||
|show|`boolean`|`false`||
|placement|`'top' \| 'right' \| 'bottom' \| 'left'`|`'right'`||
|width|`number \| string`|`251`||
|height|`number \| string`|`251`|Works when placement is `top` and `bottom`.|
|mask-closable|`boolean`|`true`|Whether to emit `hide` event when click mask.|
|drawer-style|`object`|`null`||
|drawer-class|`string`|`null`||
## Slots
|Name|Parameters|Description|

View File

@ -17,12 +17,15 @@ dark-4-debug
## Props
|名称|类型|默认值|说明|
|-|-|-|-|
|theme|`'light' \| 'dark'`|`null`||
|themed-style|`{ [themeName: string]: object }`|`null`||
|show|`boolean`|`false`||
|placement|`'top' \| 'right' \| 'bottom' \| 'left'`|`'right'`||
|width|`number \| string`|`251`||
|height|`number \| string`|`251`|在位置是 `top``bottom` 时生效|
|mask-closable|`boolean`|`true`|点击遮罩时是否发出 `hide` 事件|
|drawer-style|`object`|`null`||
|drawer-class|`string`|`null`||
## Slots
|名称|参数|说明|

View File

@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "0.7.24",
"version": "0.7.25",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",

View File

@ -20,12 +20,15 @@
class="n-drawer"
:style="{
...drawerStyle,
...themedStyle,
width: styleWidth,
height: styleHeight
}"
:class="{
[`n-drawer--${placement}-placement`]: true,
[`n-${syntheticTheme}-theme`]: syntheticTheme
[`n-${syntheticTheme}-theme`]: syntheticTheme,
[drawerClass]: drawerClass,
[namespace]: namespace
}"
>
<slot />
@ -82,6 +85,10 @@ export default {
type: Object,
default: null
},
drawerClass: {
type: String,
default: null
},
/** Todo */
target: {
type: Function,

View File

@ -464,7 +464,7 @@ function createScriptImportStatements (componentNames = [], format = 'esm') {
}
function createScriptImportStatement (componentName, format = 'esm') {
return `import N${componentName} from ${scriptPrefix[format]}${componentName}`
return `import N${componentName} from '${scriptPrefix[format]}${componentName}'`
}
function createStyleImportStatements (componentNames = [], format = 'esm') {
@ -484,11 +484,12 @@ function createStyleImportStatements (componentNames = [], format = 'esm') {
function createStyleImportStatement (styleFile, format) {
if (styleFile.startsWith('~')) {
return (
'import ' +
styleFile.slice(1, styleFile.length)
'import \'' +
styleFile.slice(1, styleFile.length) +
'\''
)
}
return `import ${stylePrefix[format]}${styleFile}${styleExtension[format]}`
return `import '${stylePrefix[format]}${styleFile}${styleExtension[format]}'`
}
function createImportStatements (componentNames = [], format = 'esm') {
@ -499,12 +500,12 @@ function createImportStatements (componentNames = [], format = 'esm') {
}
function createLocaleImportStatements (locales = ['zhCN', 'enUS'], format = 'ems') {
return locales.map(locale => `import ${locale} from ${scriptPrefix[format]}locale/${locale}`).join('\n') + '\n\n'
return locales.map(locale => `import ${locale} from '${scriptPrefix[format]}locale/${locale}'`).join('\n') + '\n\n'
}
function createInitializeStatements (components = [], locales = ['zhCN', 'enUS'], format = 'esm') {
return (
`import create from ${scriptPrefix[format]}create\n\n` +
`import create from '${scriptPrefix[format]}create'\n\n` +
createLocaleImportStatements(locales, format) +
`const naive = create({\n` +
` components: [\n` +

View File

@ -125,6 +125,9 @@ const devtoolIsOpened = e.target === document.activeElement
## 2020.3.8
zindex 有点问题
## 2020.3.11
zindex 的问题解决了,虽然很简单,在 static 元素上设定 zindex 没用,😅
## TODO 排序不分先后
1. <del>Focus Detector on Time Selector</del>