tangjinzhou
7 years ago
11 changed files with 147 additions and 34 deletions
@ -0,0 +1,17 @@
|
||||
<template> |
||||
<div> |
||||
<AntButton type="primary">Primary</AntButton> |
||||
<AntButton>Default</AntButton> |
||||
<AntButton type="dashed">Dashed</AntButton> |
||||
<AntButton type="danger">Danger</AntButton> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import '../style' |
||||
import { Button } from 'antd' |
||||
export default { |
||||
components: { |
||||
AntButton: Button, |
||||
}, |
||||
} |
||||
</script> |
@ -0,0 +1,96 @@
|
||||
<template> |
||||
<div> |
||||
<AntButton :type="this.type" @click="handleClick" class="test"> |
||||
primary |
||||
</AntButton> |
||||
<AntButton @mouseover="handleClick" @mouseout="handleClick">Default</AntButton> |
||||
<AntButton type="dashed">Dashed</AntButton> |
||||
<AntButton type="danger">Danger</AntButton> |
||||
<br /> |
||||
<AntButton type="primary" shape="circle" icon="search" /> |
||||
<AntButton type="primary" icon="search">Search</AntButton> |
||||
<AntButton shape="circle" icon="search" /> |
||||
<AntButton icon="search">Search</AntButton> |
||||
<br /> |
||||
<AntButton shape="circle" icon="search" /> |
||||
<AntButton icon="search">Search</AntButton> |
||||
<AntButton type="dashed" shape="circle" icon="search" /> |
||||
<AntButton type="dashed" icon="search">Search</AntButton> |
||||
<div> |
||||
<AntButton type="primary">Primary</AntButton> |
||||
<AntButton type="primary" disabled>Primary(disabled)</AntButton> |
||||
<br /> |
||||
<AntButton>Default</AntButton> |
||||
<AntButton disabled>Default(disabled)</AntButton> |
||||
<br /> |
||||
<AntButton>Ghost</AntButton> |
||||
<AntButton disabled>Ghost(disabled)</AntButton> |
||||
<br /> |
||||
<AntButton type="dashed">Dashed</AntButton> |
||||
<AntButton type="dashed" disabled>Dashed(disabled)</AntButton> |
||||
</div> |
||||
<div :style="{background: 'rgb(190, 200, 200)', padding: '26px 16px 16px'}"> |
||||
<AntButton type="primary" ghost>Primary</AntButton> |
||||
<AntButton ghost>Default</AntButton> |
||||
<AntButton type="dashed" ghost>Dashed</AntButton> |
||||
<AntButton type="danger" ghost>danger</AntButton> |
||||
</div> |
||||
<div> |
||||
<AntButton type="primary" loading> |
||||
Loading |
||||
</AntButton> |
||||
<AntButton type="primary" size="small" loading> |
||||
Loading |
||||
</AntButton> |
||||
<br /> |
||||
<AntButton type="primary"> |
||||
Click me! |
||||
</AntButton> |
||||
<AntButton type="primary" icon="poweroff"> |
||||
Click me! |
||||
</AntButton> |
||||
<br /> |
||||
<AntButton shape="circle" loading /> |
||||
<AntButton type="primary" shape="circle" loading /> |
||||
</div> |
||||
<div> |
||||
<ButtonGroup> |
||||
<AntButton>Cancel</AntButton> |
||||
<AntButton type="primary">OK</AntButton> |
||||
</ButtonGroup> |
||||
<ButtonGroup size="large"> |
||||
<AntButton disabled>L</AntButton> |
||||
<AntButton disabled>M</AntButton> |
||||
<AntButton disabled>R</AntButton> |
||||
</ButtonGroup> |
||||
<ButtonGroup size="small"> |
||||
<AntButton type="primary">L</AntButton> |
||||
<AntButton>M</AntButton> |
||||
<AntButton>M</AntButton> |
||||
<AntButton type="dashed">R</AntButton> |
||||
</ButtonGroup> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import '../style' |
||||
import { Button } from 'antd' |
||||
const ButtonGroup = Button.Group |
||||
export default { |
||||
data () { |
||||
return { |
||||
type: 'primary', |
||||
} |
||||
}, |
||||
methods: { |
||||
handleClick (event) { |
||||
console.log(event) |
||||
this.type = this.type === 'primary' ? 'danger' : 'primary' |
||||
}, |
||||
}, |
||||
components: { |
||||
AntButton: Button, |
||||
ButtonGroup, |
||||
}, |
||||
} |
||||
</script> |
@ -1,28 +1,16 @@
|
||||
import Vue from 'vue' |
||||
import Checkbox from './checkbox.vue' |
||||
import Button from './button.vue' |
||||
import Radio from './radio.vue' |
||||
import Grid from './grid.vue' |
||||
// import Dialog from './dialog.vue'
|
||||
import Rate from './rate.vue' |
||||
import './index.less' |
||||
import Vue from 'vue' |
||||
import VueMarkdown from 'vue-markdown' |
||||
import VueRouter from 'vue-router' |
||||
import routes from './routes' |
||||
Vue.use(VueRouter) |
||||
|
||||
const router = new VueRouter({ |
||||
mode: 'history', |
||||
routes, |
||||
}) |
||||
Vue.component('vue-markdown', VueMarkdown) |
||||
new Vue({ |
||||
el: '#app', |
||||
template: ` |
||||
<div> |
||||
<Grid /> |
||||
<Checkbox /> |
||||
<AntButton /> |
||||
<Radio /> |
||||
<Rate /> |
||||
</div> |
||||
`,
|
||||
components: { |
||||
AntButton: Button, |
||||
// AntDialog: Dialog,
|
||||
Checkbox, |
||||
Grid, |
||||
Radio, |
||||
Rate, |
||||
}, |
||||
router, |
||||
}) |
||||
|
@ -0,0 +1,11 @@
|
||||
const AsyncComp = () => { |
||||
const pathnameArr = window.location.pathname.split('/') |
||||
const com = pathnameArr[1] || 'button' |
||||
const demo = pathnameArr[2] || 'basic' |
||||
return { |
||||
component: import(`../components/${com}/demo/${demo}.vue`), |
||||
} |
||||
} |
||||
export default [ |
||||
{ path: '/*', component: AsyncComp }, |
||||
] |
Loading…
Reference in new issue