mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 02:16:12 +08:00
[improvement] Info: jsx (#2529)
This commit is contained in:
parent
2a2ab4c929
commit
f41b9d3bd3
13
packages/info/index.js
Normal file
13
packages/info/index.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { use, isDef } from '../utils';
|
||||||
|
|
||||||
|
const [sfc, bem] = use('info');
|
||||||
|
|
||||||
|
export default sfc({
|
||||||
|
props: {
|
||||||
|
info: [String, Number]
|
||||||
|
},
|
||||||
|
|
||||||
|
render(h) {
|
||||||
|
return isDef(this.info) && <div class={bem()}>{this.info}</div>;
|
||||||
|
}
|
||||||
|
});
|
@ -1,19 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
v-if="isDef(info)"
|
|
||||||
v-text="info"
|
|
||||||
:class="b()"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import create from '../utils/create-basic';
|
|
||||||
|
|
||||||
export default create({
|
|
||||||
name: 'info',
|
|
||||||
|
|
||||||
props: {
|
|
||||||
info: [String, Number]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
Loading…
x
Reference in New Issue
Block a user