mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-11-30 02:57:50 +08:00
add md
This commit is contained in:
parent
a8c4f7662a
commit
693b033b46
@ -1,9 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
<md>
|
||||
## 基本
|
||||
默认选中第一项。
|
||||
</md>
|
||||
<Tabs defaultActiveKey="1" @change="callback">
|
||||
<TabPane tab="Tab 1" key="1">Content of Tab Pane 1</TabPane>
|
||||
<TabPane tab="Tab 2" key="2" forceRender>Content of Tab Pane 2</TabPane>
|
||||
<TabPane tab="Tab 3" key="3">Content of Tab Pane 3</TabPane>
|
||||
</Tabs>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Tabs } from 'antd'
|
||||
|
@ -1,59 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<Checkbox :defaultChecked="true" @change="change" value="1">1</Checkbox>
|
||||
<Checkbox v-model="checked" @change="change" value="2">2</Checkbox>
|
||||
<Checkbox @change="change" v-model="checked" name="test" value="123">Checkbox</Checkbox>
|
||||
<Checkbox @change="change" v-model="checked" name="test2" value="222">Checkbox</Checkbox>
|
||||
|
||||
<CheckboxGroup v-model="value" @change="change">
|
||||
<AntButton @click="handleClick">
|
||||
全选
|
||||
</AntButton>
|
||||
<AntButton @click="handleAddClick">
|
||||
{{showMore ? "删除": "添加"}}
|
||||
</AntButton>
|
||||
<div>
|
||||
<Checkbox name="test1" value="1">Checkbox1</Checkbox>
|
||||
</div>
|
||||
<Checkbox name="test2" value="2" disabled>Checkbox2</Checkbox>
|
||||
<Checkbox name="test3" value="3" @change="change">Checkbox3</Checkbox>
|
||||
<Checkbox v-if="showMore" name="test4" value="4">Checkbox4</Checkbox>
|
||||
</CheckboxGroup>
|
||||
<CheckboxGroup :options="options" :defaultValue="['Apple']" @change="change"></CheckboxGroup>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Button, Checkbox } from '../components/index'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: true,
|
||||
checked: true,
|
||||
options: [
|
||||
{ label: 'Apple', value: 'Apple' },
|
||||
{ label: 'Pear', value: 'Pear' },
|
||||
{ label: 'Orange', value: 'Orange', disabled: false },
|
||||
],
|
||||
value: ['1'],
|
||||
value1: [],
|
||||
showMore: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
change (event) {
|
||||
console.log(event)
|
||||
},
|
||||
handleClick () {
|
||||
this.value = ['1', '2', '3']
|
||||
},
|
||||
handleAddClick () {
|
||||
this.showMore = !this.showMore
|
||||
},
|
||||
},
|
||||
components: {
|
||||
Checkbox,
|
||||
CheckboxGroup: Checkbox.Group,
|
||||
AntButton: Button,
|
||||
},
|
||||
}
|
||||
</script>
|
@ -3,7 +3,9 @@ import './index.less'
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import routes from './routes'
|
||||
import Md from './md'
|
||||
Vue.use(VueRouter)
|
||||
Vue.component(Md.name, Md)
|
||||
|
||||
const router = new VueRouter({
|
||||
mode: 'history',
|
||||
|
25
examples/md.vue
Normal file
25
examples/md.vue
Normal file
@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<div v-html="marked($slots.default[0].text.trim() || '')" />
|
||||
</template>
|
||||
<script>
|
||||
import marked from 'marked'
|
||||
marked.setOptions({
|
||||
renderer: new marked.Renderer(),
|
||||
gfm: true,
|
||||
tables: true,
|
||||
breaks: false,
|
||||
pedantic: true,
|
||||
sanitize: true,
|
||||
smartLists: true,
|
||||
smartypants: true,
|
||||
})
|
||||
export default {
|
||||
name: 'md',
|
||||
data () {
|
||||
console.log(this.$slots.default)
|
||||
return {
|
||||
marked,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
@ -1,62 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<Radio @change="change" :defaultChecked="true" name="test" value="123">Radio</Radio>
|
||||
<Radio :checked="false" @change="change" name="test2" value="222">Radio</Radio>
|
||||
|
||||
<RadioGroup v-model="value" @change="change">
|
||||
<AntButton @click="handleAddClick">
|
||||
{{showMore ? "删除": "添加"}}
|
||||
</AntButton>
|
||||
<Radio name="test1" value="1">Radio1</Radio>
|
||||
<Radio name="test2" value="2" disabled>Radio2</Radio>
|
||||
<Radio name="test3" value="3" @change="change">Radio3</Radio>
|
||||
<Radio v-if="showMore" name="test4" value="4">Radio4</Radio>
|
||||
</RadioGroup>
|
||||
<RadioGroup :options="options" v-model="value1" @change="change"></RadioGroup>
|
||||
<div>
|
||||
<RadioGroup :defaultValue="'a'" size="large">
|
||||
<RadioButton value="a">Hangzhou</RadioButton>
|
||||
<RadioButton value="b">Shanghai</RadioButton>
|
||||
<RadioButton value="c">Beijing</RadioButton>
|
||||
<RadioButton value="d">Chengdu</RadioButton>
|
||||
</RadioGroup>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Button, Radio } from '../components/index'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: true,
|
||||
checked: false,
|
||||
options: [
|
||||
{ label: 'Apple', value: 'Apple' },
|
||||
{ label: 'Pear', value: 'Pear' },
|
||||
{ label: 'Orange', value: 'Orange', disabled: true },
|
||||
],
|
||||
value: '1',
|
||||
value1: '',
|
||||
value2: 'a',
|
||||
showMore: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
change (event) {
|
||||
console.log(event)
|
||||
},
|
||||
handleClick () {
|
||||
this.value = ['1', '2', '3']
|
||||
},
|
||||
handleAddClick () {
|
||||
this.showMore = !this.showMore
|
||||
},
|
||||
},
|
||||
components: {
|
||||
Radio,
|
||||
RadioGroup: Radio.Group,
|
||||
RadioButton: Radio.Button,
|
||||
AntButton: Button,
|
||||
},
|
||||
}
|
||||
</script>
|
@ -57,6 +57,7 @@
|
||||
"karma-webpack": "^2.0.2",
|
||||
"less": "^2.7.2",
|
||||
"less-loader": "^4.0.5",
|
||||
"marked": "^0.3.7",
|
||||
"mocha": "^3.2.0",
|
||||
"pre-commit": "^1.2.2",
|
||||
"selenium-server": "^3.0.1",
|
||||
|
Loading…
Reference in New Issue
Block a user