[improvement] GoodsAction: tsx (#2786)

This commit is contained in:
neverland
2019-02-18 20:59:38 +08:00
committed by GitHub
parent c372638036
commit b9d7143fb3
7 changed files with 116 additions and 80 deletions
+1 -2
View File
@@ -89,13 +89,12 @@ Use `info` prop to show messages in upper right corner of icon
|------|------|------|------|
| text | Button text | `String` | - |
| icon | Icon | `String` | - |
| icon-class | Icon class name | `String` | `''` |
| icon-class | Icon class name | `any` | `''` |
| info | Info message | `String | Number` | - |
| url | Link | `String` | - |
| to | Target route of the link, same as to of `vue-router` | `String | Object` | - |
| replace | If true, the navigation will not leave a history record | `String` | `false` |
#### GoodsActionBigBtn
| Attribute | Description | Type | Default |
@@ -1,9 +1,18 @@
import { use } from '../utils';
import { inherit } from '../utils/functional';
// Types
import { CreateElement, RenderContext } from 'vue/types';
import { DefaultProps, DefaultSlots } from '../utils/use/sfc';
const [sfc, bem] = use('goods-action');
function GoodsAction(h, props, slots, ctx) {
function GoodsAction(
h: CreateElement,
props: DefaultProps,
slots: DefaultSlots,
ctx: RenderContext
) {
return (
<div class={bem()} {...inherit(ctx, true)}>
{slots.default && slots.default()}
+1 -1
View File
@@ -88,7 +88,7 @@ export default {
|------|------|------|------|------|
| text | 按钮文字 | `String` | - | - |
| icon | 图标 | `String` | - | - |
| icon-class | 图标额外类名 | `String` | - | - |
| icon-class | 图标额外类名 | `any` | - | - |
| info | 图标右上角提示信息 | `String | Number` | - | - |
| url | 跳转链接 | `String` | - | - |
| to | 路由跳转对象,同 `vue-router` 的 to | `String | Object` | - | - |