From 892dcb5a0c3cc740ef4bc869603f322e318bb70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Forment=C3=A3o?= Date: Sat, 30 Jun 2018 11:37:41 -0300 Subject: [PATCH] fix(docz-example-vue): rework examples and remove imports --- examples/vue/src/components/Alert.mdx | 15 +++-- examples/vue/src/components/Alert.vue | 26 +++++++- examples/vue/src/components/Button.mdx | 57 +++++++++++++++++ examples/vue/src/components/Button.vue | 85 ++++++++++++++++++++++++++ 4 files changed, 172 insertions(+), 11 deletions(-) create mode 100644 examples/vue/src/components/Button.mdx create mode 100644 examples/vue/src/components/Button.vue diff --git a/examples/vue/src/components/Alert.mdx b/examples/vue/src/components/Alert.mdx index 1a7f9df..7284af1 100644 --- a/examples/vue/src/components/Alert.mdx +++ b/examples/vue/src/components/Alert.mdx @@ -9,22 +9,21 @@ import Alert from './Alert.vue' # Alert ## Properties - - +Some message} /> ## Basic usage - Some message + Some message ## Using different kinds - Some message - Some message - Some message - Some message + Some message + Some message + Some message + Some message ## Use with children as a function @@ -34,7 +33,7 @@ import Alert from './Alert.vue' const message = 'Hello world' return ( - {message} + {message} ) }} diff --git a/examples/vue/src/components/Alert.vue b/examples/vue/src/components/Alert.vue index 786b9fe..308e957 100644 --- a/examples/vue/src/components/Alert.vue +++ b/examples/vue/src/components/Alert.vue @@ -1,7 +1,6 @@ @@ -11,14 +10,35 @@ props: { kind: { type: String, + required: false, default: 'info' } }, + computed: { + typeClass() { + return `alert--${ this.kind }`; + }, + } } diff --git a/examples/vue/src/components/Button.mdx b/examples/vue/src/components/Button.mdx new file mode 100644 index 0000000..a7df8c8 --- /dev/null +++ b/examples/vue/src/components/Button.mdx @@ -0,0 +1,57 @@ +--- +name: Button +menu: Components +--- + +import { Playground, PropsTable } from 'docz' +import Button from './Button.vue' + +# Button + +Buttons make common actions more obvious and help users more easily perform them. Buttons use labels and sometimes icons to communicate the action that will occur when the user touches them. + +### Best practices + +- Group buttons logically into sets based on usage and importance. +- Ensure that button actions are clear and consistent. +- The main action of a group set can be a primary button. +- Select a single button variation and do not mix them. + +## Properties + +} /> + +## Basic usage + + + Click me + + +## With different sizes + + + Click me + Click me + Click me + + +## With different colors + + + Click me + Click me + Click me + Click me + Click me + + +## Outlined + + + Click me + Click me + Click me + Click me + Click me + + diff --git a/examples/vue/src/components/Button.vue b/examples/vue/src/components/Button.vue new file mode 100644 index 0000000..e98cbe4 --- /dev/null +++ b/examples/vue/src/components/Button.vue @@ -0,0 +1,85 @@ + + + + +