Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
feat(components/card): create
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaddeusJiang committed Mar 13, 2021
1 parent a7618ce commit 17f11cd
Show file tree
Hide file tree
Showing 6 changed files with 3,583 additions and 191 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
.nuxt-storybook
storybook-static
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
Expand Down
6 changes: 6 additions & 0 deletions components/Card.stories.js
@@ -0,0 +1,6 @@
export default {
title: 'Card',
}

export const DefaultCard = () =>
`<card style="width: 400px" cover="https://www.muji.com/public/media/jp/img/visual/6699316/aboutryohin_02_201221_thumb_thumb.jpg" title="良品計画サイト" description="サステナピリティ">`
34 changes: 34 additions & 0 deletions components/Card.vue
@@ -0,0 +1,34 @@
<template>
<div class="rounded border shadow w-auto">
<figure>
<img :src="cover" :alt="description" />
</figure>

<div class="p-4">
<div v-if="title" class="text-black text-opacity-50">{{ title }}</div>
<div v-if="description" class="text-sm">{{ description }}</div>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from '@nuxtjs/composition-api'
export default defineComponent({
props: {
cover: {
type: String,
required: true,
},
title: {
type: String,
default: '',
},
description: {
type: String,
default: '',
},
},
setup() {},
})
</script>
4 changes: 3 additions & 1 deletion nuxt.config.js
Expand Up @@ -32,7 +32,9 @@ export default {
'nuxt-windicss',
'@nuxtjs/composition-api',
],

storybook: {
// Options
},
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
Expand Down
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -7,6 +7,7 @@
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"storybook": "nuxt storybook",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"lint:style": "stylelint \"**/*.{vue,css}\" --ignore-path .gitignore",
"lint": "yarn lint:js && yarn lint:style",
Expand Down Expand Up @@ -38,6 +39,7 @@
"@nuxt/typescript-build": "^2.0.4",
"@nuxtjs/eslint-config-typescript": "^5.0.0",
"@nuxtjs/eslint-module": "^3.0.2",
"@nuxtjs/storybook": "^3.3.1",
"@nuxtjs/stylelint-module": "^4.0.0",
"@vue/test-utils": "^1.1.2",
"babel-core": "7.0.0-bridge.0",
Expand All @@ -59,6 +61,7 @@
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^20.0.0",
"ts-jest": "^26.4.4",
"ts-node": "^9.1.1",
"vue-jest": "^3.0.4"
},
"config": {
Expand Down

0 comments on commit 17f11cd

Please sign in to comment.