Skip to content

Commit

Permalink
refactor(cli): add pc component preview to generators
Browse files Browse the repository at this point in the history
affects: @varlet/cli
  • Loading branch information
haoziqaq committed Sep 15, 2021
1 parent be463ad commit 03618fd
Show file tree
Hide file tree
Showing 12 changed files with 3,753 additions and 935 deletions.
2 changes: 1 addition & 1 deletion packages/varlet-cli/generators/sfc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"vue": "^3.0.0"
},
"devDependencies": {
"@varlet/cli": "^1.17.2",
"@varlet/cli": "^1.20.0-alpha.0",
"vue": "3.1.4"
},
"release-it": {
Expand Down
8 changes: 8 additions & 0 deletions packages/varlet-cli/generators/sfc/src/button/docs/zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ createApp().use(Button)
<b-button>组件库从我开始</b-button>
```

```vue
import BasicUse from '../example/BasicUse'
```

### 主题色按钮
```html
<b-button color="#009688">组件库从我开始</b-button>
```

```vue
import ModifyColor from '../example/ModifyColor'
```

## API

### 属性
Expand Down
14 changes: 14 additions & 0 deletions packages/varlet-cli/generators/sfc/src/button/example/BasicUse.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<b-button>组件库从我开始</b-button>
</template>

<script>
import Button from '../Button'
export default {
name: 'BasicUse',
components: {
[Button.name]: Button
}
}
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<b-button color="#03A9F4">组件库从我开始</b-button>
</template>

<script>
import Button from '../Button'
export default {
name: 'ModifyColor',
components: {
[Button.name]: Button
}
}
</script>
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<template>
<app-type>基本使用</app-type>
<b-button>组件库从我开始</b-button>
<basic-use/>

<app-type>修改颜色</app-type>
<b-button color="#03A9F4">组件库从我开始</b-button>
<modify-color/>
</template>

<script>
import Button from '../Button'
import AppType from '@varlet/cli/site/mobile/components/AppType'
import BasicUse from './BasicUse'
import ModifyColor from './ModifyColor'
export default {
components: {
[Button.name]: Button,
AppType,
BasicUse,
ModifyColor
},
}
</script>
Loading

0 comments on commit 03618fd

Please sign in to comment.