在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ render函數(shù)實(shí)現(xiàn)Modal,怎么才能給它添加參數(shù)呢?比如給Modal添加st

render函數(shù)實(shí)現(xiàn)Modal,怎么才能給它添加參數(shù)呢?比如給Modal添加style。

iView的Modal中使用render函數(shù)實(shí)現(xiàn)Modal的展示,這里可以有子塊Input的參數(shù):

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;
                                }
                            }
                        })
                    }
                })
            }
        }
        

但是請(qǐng)問一下,怎么才能給Modal添加參數(shù)呢?比如給Modal添加style。 請(qǐng)輸入代碼

回答
編輯回答
挽青絲

看官方文檔,鏈接在此https://cn.vuejs.org/v2/guide...

2017年6月25日 15:56
編輯回答
陌璃

謝謝yuanxiaowa,我結(jié)合iView的modal文檔做出來了:

context.$Modal.info({
    render: (h) => {
      return h('img', {
          attrs: {
            src: img_url,
            style: img_style
          },
          on: {},
        },
      )
    },
    title: "文件預(yù)覽",
    styles: "{width: '100%';}"
  })
2017年6月11日 12:54