iview/examples/routers/modal.vue
2018-06-27 09:51:38 +08:00

40 lines
1 KiB
Vue

<template>
<div>
<p>
Name: {{ value }}
</p>
<p>
<Button @click="handleRender">Custom content</Button>
</p>
</div>
</template>
<script>
export default {
data () {
return {
value: ''
}
},
methods: {
handleRender () {
this.$Modal.confirm({
title: '真不错呀',
render: (h) => {
return h('Input', {
props: {
value: this.value,
autofocus: true,
placeholder: 'Please enter your name...'
},
on: {
input: (val) => {
this.value = val;
}
}
})
}
})
}
}
}
</script>