mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-02-23 13:31:06 +08:00
chore: clean card & code & radio codes
This commit is contained in:
parent
0023479f68
commit
321aa08b23
@ -167,15 +167,12 @@ export default defineComponent({
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
{
|
||||
<div class="n-card__content" style={this.contentStyle}>
|
||||
{this.$slots}
|
||||
</div>
|
||||
}
|
||||
<div class="n-card__content" style={this.contentStyle}>
|
||||
{$slots}
|
||||
</div>
|
||||
{$slots.footer ? (
|
||||
<div class="n-card__footer">{renderSlot($slots, 'footer')}</div>
|
||||
) : null}
|
||||
|
||||
{$slots.action ? (
|
||||
<div class="n-card__action">{renderSlot($slots, 'action')}</div>
|
||||
) : null}
|
||||
|
@ -6,7 +6,8 @@ import {
|
||||
onMounted,
|
||||
ref,
|
||||
computed,
|
||||
PropType
|
||||
PropType,
|
||||
CSSProperties
|
||||
} from 'vue'
|
||||
import { useTheme, useHljs, Hljs } from '../../_mixins'
|
||||
import type { ThemeProps } from '../../_mixins'
|
||||
@ -116,19 +117,10 @@ export default defineComponent({
|
||||
},
|
||||
render () {
|
||||
const { default: defaultSlot } = this.$slots
|
||||
return h(
|
||||
'code',
|
||||
{
|
||||
class: 'n-code',
|
||||
style: this.cssVars
|
||||
},
|
||||
[
|
||||
defaultSlot
|
||||
? defaultSlot()
|
||||
: h('pre', {
|
||||
ref: 'codeRef'
|
||||
})
|
||||
]
|
||||
return (
|
||||
<code class="n-code" style={this.cssVars as CSSProperties}>
|
||||
{defaultSlot ? defaultSlot() : <pre ref="codeRef"></pre>}
|
||||
</code>
|
||||
)
|
||||
}
|
||||
})
|
@ -8,7 +8,8 @@ import {
|
||||
ref,
|
||||
toRef,
|
||||
reactive,
|
||||
VNodeChild
|
||||
VNodeChild,
|
||||
CSSProperties
|
||||
} from 'vue'
|
||||
import { useMergedState } from 'vooks'
|
||||
import { useTheme, useFormItem } from '../../_mixins'
|
||||
@ -79,9 +80,7 @@ function mapSlot (
|
||||
? currentInstanceClass
|
||||
: lastInstanceClass
|
||||
children.push(
|
||||
h('div', {
|
||||
class: ['n-radio-group__splitor', splitorClass]
|
||||
}),
|
||||
<div class={['n-radio-group__splitor', splitorClass]}></div>,
|
||||
wrappedInstance
|
||||
)
|
||||
}
|
||||
@ -214,18 +213,16 @@ export default defineComponent({
|
||||
flatten(getSlot(this)),
|
||||
mergedValue
|
||||
)
|
||||
return h(
|
||||
'div',
|
||||
{
|
||||
class: [
|
||||
return (
|
||||
<div
|
||||
class={[
|
||||
'n-radio-group',
|
||||
{
|
||||
'n-radio-group--button-group': isButtonGroup
|
||||
}
|
||||
],
|
||||
style: this.cssVars
|
||||
},
|
||||
children
|
||||
isButtonGroup && 'n-radio-group--button-group'
|
||||
]}
|
||||
style={this.cssVars as CSSProperties}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue
Block a user