modal.vue
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<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>