比如ant-desing-vue框架的modal组件是这样用的:
在页面上引入组件,然后写在页面上
<a-modal title="Basic Modal" v-model="visible" @ok="handleOk"> <p>Some contents...</p> <p>Some contents...</p> <p>Some contents...</p> </a-modal>
效果是这样的:
现在因为我有很多地方都需要用这个组件,我想直接用js的方式调用这个组件。
比如this.$modal.show(title, content),title就是标题,content直接传入一个component,就是弹窗显示的内容,
然后可以用this.$modal.hidden()来关闭这个弹窗
请问下该如何实现,或者说思路是大概是什么样的?
待解决
悬赏分:0
- 离问题结束还有 52天8小时33分43秒
点赞 0反对 0举报 0
收藏 0
分享 0
