<!-- UpLoading --> <template id="upLoading"> <form method="post" action="UploadServlet" enctype="multipart/form-data"> 选择一个文件: <input type="file" name="uploadFile" /> <br/><br/> <input type="submit" value="上传" /> </form> </template> <script type="text/javascript"> "use strict"; Vue.component('up-Loading', { template : '#upLoading', data: function () { show : false }, methods:{ Show:function() { this.show = true; }, Hide:function() { this.show = false; } } });</script>
模板调用:
<up-Loading ref="uiloading"></up-Loading> 显示控制: this.$refs.uiloading.Show();
VUE模板的创建
最新推荐文章于 2024-06-11 01:02:06 发布