Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Dialog components

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "the use of Dialog components". In daily operation, I believe many people have doubts about the use of Dialog components. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about the use of Dialog components. Next, please follow the editor to study!

1.Dialog usage immediately create cancel

Corresponding js code

New Vue ({el:'# app', data: {bkBizData: [], addDialog:false, addForm: {add_bk_biz:', add_temp_name:', add_temp_script:', add_temp_note:'' Add_temp_threshold:''}, rules: {bk_biz: [{required: true, message: 'select a business', trigger: 'change'}], temp_name: [{required: true Message: 'please enter template name', trigger: 'blur'}, {min: 2, max: 8, message:' length of 2 to 8 characters', trigger: 'change'}], temp_script: [{required: true, message:' please enter inspection script' Trigger: 'blur'}], temp_note: [{required: true, message:' please enter comments', trigger: 'blur'}, {min: 2, message:' at least 2 digits', trigger: 'blur'}] Temp_value: [{type: 'number', required: true, message:' please enter threshold', trigger: 'change'}]}}, mounted () {/ / get all templates this.init ()} when the page is loaded Methods: {init () {axios.get (site_url + "get_biz_list/") .then (res = > {if (res.data.result) {this.bkBizData = res.data.data) } else {this.$message.error ('failed to acquire business');}}, 'json'); this.getSearch () }, getSearch () {axios.get (site_url + "temp_view/?search_biz=" + this.searchBiz + "& query_str=" + this.searchTempName) .then (res = > {if (res.data.result) {this.tempData = res.data.data) } else {this.$message.error ('failed to get template');}}, 'json') }, addDialogOk () {this.$refs ['addForm'] .validate ((valid) = > {if (valid) {axios.post (site_url + "temp_view/") This.addForm) .then (res = > {if (res.data.result) {this.$message.success ('template added successfully') This.addDialog = false; this.getSearch () This.addForm = {add_bk_biz:', add_temp_name:', add_temp_script:'' Add_temp_value:', add_temp_note:'} else {this.$message.error ('failed to add template') }}, 'json');} else {console.log (' error submittal signals'); return false At this point, the study on "how to use Dialog components" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report