Blame view

examples/routers/modal.vue 1.04 KB
6259471f   梁灏   support Modal
1
2
  <template>
      <div>
172e4396   梁灏   update $Modal wit...
3
4
5
6
7
8
          <p>
              Name: {{ value }}
      </p>
          <p>
              <Button @click="handleRender">Custom content</Button>
          </p>
6259471f   梁灏   support Modal
9
10
11
12
      </div>
  </template>
  <script>
      export default {
172e4396   梁灏   update $Modal wit...
13
14
15
16
17
          data () {
              return {
                  value: ''
              }
          },
6259471f   梁灏   support Modal
18
          methods: {
172e4396   梁灏   update $Modal wit...
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
              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;
                                  }
                              }
                          })
                      }
                  })
6259471f   梁灏   support Modal
37
38
39
40
              }
          }
      }
  </script>