How can the render function implement Modal, add parameters to it? For example, add style to Modal.

The Modal of

iView uses the render function to display Modal. Here you can have the parameters of the sub-block Input :

methods: {
            handleRender () {
                this.$Modal.confirm({
                    render: (h) => {
                        return h("Input", {
                            props: {
                                value: this.value,
                                autofocus: true,
                                placeholder: "Please enter your name..."
                            },
                            on: {
                                input: (val) => {
                                    this.value = val;
                                }
                            }
                        })
                    }
                })
            }
        }
        

but excuse me, how can I add parameters to Modal? For example, add style to Modal. Please enter the code

Feb.27,2021

see the official documentation, and the link is here ide/render-function.html-sharp%E6%B7%B1%E5%85%A5-data-%E5%AF%B9%E8%B1%A1" rel=" nofollow noreferrer "> https://cn.vuejs.org/v2/guide.


Thank you, yuanxiaowa,. I made it in combination with iView's modal document:

context.$Modal.info({
    render: (h) => {
      return h('img', {
          attrs: {
            src: img_url,
            style: img_style
          },
          on: {},
        },
      )
    },
    title: "",
    styles: "{width: '100%';}"
  })
Menu