docs(popover, tooltip): body-style

This commit is contained in:
07akioni 2020-12-15 16:36:11 +08:00
parent 3e40af2a44
commit 317a17b436
4 changed files with 32 additions and 40 deletions

View File

@ -1,7 +1,7 @@
# Body Style
```html
<n-popover :body-style="{ width: '500px' }" trigger="hover">
<n-popover :style="{ width: '500px' }" trigger="hover">
<template v-slot:trigger>
<n-button> Width 500px </n-button>
</template>

View File

@ -1,7 +1,7 @@
# 主体样式
```html
<n-popover :body-style="{ width: '500px' }" trigger="hover">
<n-popover :style="{ width: '500px' }" trigger="hover">
<template v-slot:trigger>
<n-button style="margin:0;"> 宽度 500px </n-button>
</template>

View File

@ -1,25 +1,21 @@
# Body Style
Setting body-style is sometimes useful.
Setting style is sometimes useful.
```html
<n-tooltip :body-style="{ maxWidth: '400px' }" trigger="click">
<template v-slot:trigger>
<n-button> California Girls </n-button>
</template>
I wish they all could be California girls. I wish they all could be California
girls. I wish they all could be California girls.
</n-tooltip>
<n-tooltip :body-style="{ maxWidth: '400px' }" trigger="click">
<template v-slot:trigger>
<n-button> California Girls </n-button>
</template>
I wish ...
</n-tooltip>
```
```css
.n-button {
margin: 0 12px 8px 0;
}
<n-space>
<n-tooltip :style="{ maxWidth: '400px' }" trigger="click">
<template v-slot:trigger>
<n-button> California Girls </n-button>
</template>
I wish they all could be California girls. I wish they all could be
California girls. I wish they all could be California girls.
</n-tooltip>
<n-tooltip :style="{ maxWidth: '400px' }" trigger="click">
<template v-slot:trigger>
<n-button> California Girls </n-button>
</template>
I wish ...
</n-tooltip>
</n-space>
```

View File

@ -3,22 +3,18 @@
有时候设定主体样式还是挺有用的。
```html
<n-tooltip :body-style="{ maxWidth: '400px' }" trigger="click">
<template v-slot:trigger>
<n-button> 加州女孩 </n-button>
</template>
我希望她们都是加州女孩,我希望她们都是加州女孩,我希望她们都是加州女孩
</n-tooltip>
<n-tooltip :body-style="{ maxWidth: '400px' }" trigger="click">
<template v-slot:trigger>
<n-button> 加州女孩 </n-button>
</template>
我希望...
</n-tooltip>
```
```css
.n-button {
margin: 0 12px 8px 0;
}
<n-space>
<n-tooltip :style="{ maxWidth: '400px' }" trigger="click">
<template v-slot:trigger>
<n-button> 加州女孩 </n-button>
</template>
我希望她们都是加州女孩,我希望她们都是加州女孩,我希望她们都是加州女孩
</n-tooltip>
<n-tooltip :style="{ maxWidth: '400px' }" trigger="click">
<template v-slot:trigger>
<n-button> 加州女孩 </n-button>
</template>
我希望...
</n-tooltip>
</n-space>
```