[improvement] Info: jsx (#2529)

This commit is contained in:
neverland 2019-01-15 21:12:00 +08:00 committed by GitHub
parent 2a2ab4c929
commit f41b9d3bd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 19 deletions

13
packages/info/index.js Normal file
View 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>;
}
});

View File

@ -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>