mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 20:04:09 +00:00
[improvement] Info: jsx (#2529)
This commit is contained in:
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>
|
|
Reference in New Issue
Block a user