mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-03 04:21:34 +08:00
doc(drawer): props doc with some fixes
This commit is contained in:
parent
c600e66d99
commit
9dd1a4dbf9
@ -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|
|
||||
|
@ -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
|
||||
|名称|参数|说明|
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "naive-ui",
|
||||
"version": "0.7.24",
|
||||
"version": "0.7.25",
|
||||
"description": "",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
|
@ -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,
|
||||
|
@ -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` +
|
||||
|
Loading…
Reference in New Issue
Block a user