ant-design-vue/components/vc-dialog/demo/ant-design.vue

143 lines
3.4 KiB
Vue
Raw Normal View History

2018-03-05 14:50:25 +00:00
<script>
/* eslint no-console:0 */
import '../assets/index.less'
// use import Dialog from 'rc-dialog'
2018-03-06 11:14:41 +00:00
import Dialog from '../index'
2018-03-05 14:50:25 +00:00
const clearPath = 'M793 242H366v-74c0-6.7-7.7-10.4-12.9' +
'-6.3l-142 112c-4.1 3.2-4.1 9.4 0 12.6l142 112c' +
'5.2 4.1 12.9 0.4 12.9-6.3v-74h415v470H175c-4.4' +
' 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-' +
'28.7 64-64V306c0-35.3-28.7-64-64-64z'
2018-03-05 14:50:25 +00:00
export default {
data () {
return {
visible: false,
width: 600,
destroyOnClose: false,
center: false,
mousePosition: {},
useIcon: false,
2018-03-05 14:50:25 +00:00
}
},
methods: {
getSvg (path, props = {}, align = false) {
return (
<i {...{ props }}>
<svg
viewBox='0 0 1024 1024'
width='1em'
height='1em'
fill='currentColor'
style={align ? { verticalAlign: '-.125em ' } : {}}
>
<path d={path} p-id='5827'></path>
</svg>
</i>
)
},
2018-03-05 14:50:25 +00:00
onClick (e) {
this.visible = true
this.mousePosition = {
x: e.pageX,
y: e.pageY,
}
},
onClose (e) {
// console.log(e);
this.visible = false
},
onDestroyOnCloseChange (e) {
this.destroyOnClose = e.target.checked
},
changeWidth (e) {
this.width = this.width === 600 ? 800 : 600
},
handleCenter (e) {
this.center = e.target.checked
},
toggleCloseIcon () {
this.useIcon = !this.useIcon
},
2018-03-05 14:50:25 +00:00
},
render () {
const style = {
width: this.width + 'px',
}
let wrapClassName = ''
if (this.center) {
wrapClassName = 'center'
}
const dialog = (
<Dialog
update to antd3.8.3 (#159) * refactor: align * feat: update align to 2.4.3 * feat: update trigger 2.5.4 * feat: update tooltip 3.7.2 * fix: align * feat: update vc-calendar to 9.6.2 * feat: update vc-checkbox to 2.1.5 * feat: update vc-dialog to 7.1.8 * feat: update vc-from to 2.2.1 * feat: update vc-notification to 3.1.1 * test: update snapshots * feat: update vc-tree to 1.12.6 * feat: update vc-table to 6.2.8 * feat: update vc-upload to 2.5.1 * feat: update vc-input-number to 4.0.12 * feat: update vc-tabs to 9.2.6 * refactor: vc-menu * refactor: update vc-menu to 7.0.5 * style: remove unused * feat: update pagination to 1.16.5 * feat: add vc-progress 2.2.5 tag * feat: add vc-rate 2.4.0 tag * feat: update vc-slider to 8.6.1 * fix: tooltip error * style: delete conosle * feat: update vc-steps to 3.1.1 * add vc-switch tag 1.6.0 * feat: update upload to 2.5.1 * fix: update vc-menu * fix: update store * fix: add ref dir * fix: trigger mock shouldComponentUpdate * fix: update vc-select * revert: trigger lazyrenderbox * fix: update vc-select * fix: update vc-select * fix: update vc-select * fix: update vc-menu * fix: update vc-slick ref * update style to 3.8.2 * test: update snapshots * update vc-select * update util & affix * feat: add drawer * fix: support title add slot mode * test: update affix test * update alert * update anchor * update snapshots * fix: doc and vc-drawer * update select & auto-complete * update back-top & grid * feractor: avatar * test: add drawer test * update badge * update button * update card * update divider * feat: update vc-tabs to 9.3.6 and tabs * add afterEnter callback * update form * fix: update drawer * test: update snapshots * update modal & notification * test: update snapshots * update message * update locale-provider * update dropdown * update layout popconfirm popover * update time-picker * update menu * update date-picker * docs: update input docs * update input * update snapshots * update table * update test snapshots * feat: update progress * update checkbox * feat: update spin * update radio * docs: slider steps timeline * update list * update transfer * update collapse * update cascader * update upload
2018-09-05 13:28:54 +00:00
// getContainer={() => this.$refs.container}
2018-03-05 14:50:25 +00:00
visible={this.visible}
wrapClassName={wrapClassName}
animation='zoom'
maskAnimation='fade'
onClose={this.onClose}
style={style}
mousePosition={this.mousePosition}
destroyOnClose={this.destroyOnClose}
closeIcon={this.useIcon ? this.getSvg(clearPath, {}, true) : undefined}
2018-03-05 14:50:25 +00:00
>
update to antd3.8.3 (#159) * refactor: align * feat: update align to 2.4.3 * feat: update trigger 2.5.4 * feat: update tooltip 3.7.2 * fix: align * feat: update vc-calendar to 9.6.2 * feat: update vc-checkbox to 2.1.5 * feat: update vc-dialog to 7.1.8 * feat: update vc-from to 2.2.1 * feat: update vc-notification to 3.1.1 * test: update snapshots * feat: update vc-tree to 1.12.6 * feat: update vc-table to 6.2.8 * feat: update vc-upload to 2.5.1 * feat: update vc-input-number to 4.0.12 * feat: update vc-tabs to 9.2.6 * refactor: vc-menu * refactor: update vc-menu to 7.0.5 * style: remove unused * feat: update pagination to 1.16.5 * feat: add vc-progress 2.2.5 tag * feat: add vc-rate 2.4.0 tag * feat: update vc-slider to 8.6.1 * fix: tooltip error * style: delete conosle * feat: update vc-steps to 3.1.1 * add vc-switch tag 1.6.0 * feat: update upload to 2.5.1 * fix: update vc-menu * fix: update store * fix: add ref dir * fix: trigger mock shouldComponentUpdate * fix: update vc-select * revert: trigger lazyrenderbox * fix: update vc-select * fix: update vc-select * fix: update vc-select * fix: update vc-menu * fix: update vc-slick ref * update style to 3.8.2 * test: update snapshots * update vc-select * update util & affix * feat: add drawer * fix: support title add slot mode * test: update affix test * update alert * update anchor * update snapshots * fix: doc and vc-drawer * update select & auto-complete * update back-top & grid * feractor: avatar * test: add drawer test * update badge * update button * update card * update divider * feat: update vc-tabs to 9.3.6 and tabs * add afterEnter callback * update form * fix: update drawer * test: update snapshots * update modal & notification * test: update snapshots * update message * update locale-provider * update dropdown * update layout popconfirm popover * update time-picker * update menu * update date-picker * docs: update input docs * update input * update snapshots * update table * update test snapshots * feat: update progress * update checkbox * feat: update spin * update radio * docs: slider steps timeline * update list * update transfer * update collapse * update cascader * update upload
2018-09-05 13:28:54 +00:00
<input autoFocus/>
2018-03-05 14:50:25 +00:00
<p>basic modal</p>
<button onClick={this.changeWidth}>change width</button>
<button onClick={this.toggleCloseIcon}>
use custom icon, is using icon: {this.useIcon && 'true' || 'false'}.
</button>
2018-03-05 14:50:25 +00:00
<div style={{ height: '200px' }} />
</Dialog>
)
return (
<div>
<h2>ant-design dialog</h2>
update to antd3.8.3 (#159) * refactor: align * feat: update align to 2.4.3 * feat: update trigger 2.5.4 * feat: update tooltip 3.7.2 * fix: align * feat: update vc-calendar to 9.6.2 * feat: update vc-checkbox to 2.1.5 * feat: update vc-dialog to 7.1.8 * feat: update vc-from to 2.2.1 * feat: update vc-notification to 3.1.1 * test: update snapshots * feat: update vc-tree to 1.12.6 * feat: update vc-table to 6.2.8 * feat: update vc-upload to 2.5.1 * feat: update vc-input-number to 4.0.12 * feat: update vc-tabs to 9.2.6 * refactor: vc-menu * refactor: update vc-menu to 7.0.5 * style: remove unused * feat: update pagination to 1.16.5 * feat: add vc-progress 2.2.5 tag * feat: add vc-rate 2.4.0 tag * feat: update vc-slider to 8.6.1 * fix: tooltip error * style: delete conosle * feat: update vc-steps to 3.1.1 * add vc-switch tag 1.6.0 * feat: update upload to 2.5.1 * fix: update vc-menu * fix: update store * fix: add ref dir * fix: trigger mock shouldComponentUpdate * fix: update vc-select * revert: trigger lazyrenderbox * fix: update vc-select * fix: update vc-select * fix: update vc-select * fix: update vc-menu * fix: update vc-slick ref * update style to 3.8.2 * test: update snapshots * update vc-select * update util & affix * feat: add drawer * fix: support title add slot mode * test: update affix test * update alert * update anchor * update snapshots * fix: doc and vc-drawer * update select & auto-complete * update back-top & grid * feractor: avatar * test: add drawer test * update badge * update button * update card * update divider * feat: update vc-tabs to 9.3.6 and tabs * add afterEnter callback * update form * fix: update drawer * test: update snapshots * update modal & notification * test: update snapshots * update message * update locale-provider * update dropdown * update layout popconfirm popover * update time-picker * update menu * update date-picker * docs: update input docs * update input * update snapshots * update table * update test snapshots * feat: update progress * update checkbox * feat: update spin * update radio * docs: slider steps timeline * update list * update transfer * update collapse * update cascader * update upload
2018-09-05 13:28:54 +00:00
<div style={{ width: '90%', margin: '0 auto' }} ref='container'>
2018-03-05 14:50:25 +00:00
<style>
{`
.center {
display: flex;
align-items: center;
justify-content: center;
}
`}
</style>
<p>
<button className='btn btn-primary' onClick={this.onClick}>
show dialog
</button>
&nbsp;
<label>
destroy on close:
<input
type='checkbox'
checked={this.destroyOnClose}
onChange={this.onDestroyOnCloseChange}
/>
</label>
&nbsp;
<label>
center
<input
type='checkbox'
checked={this.center}
onChange={this.handleCenter}
/>
</label>
</p>
{dialog}
</div>
</div>
)
},
}
2018-03-06 11:14:41 +00:00
</script>