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 solve the compatibility problem in developing projects using VueJS

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of "how to solve the compatibility problems in VueJS development projects". The editor shows you the operation process through actual cases. The operation method is simple, fast and practical. I hope this article "how to solve compatibility problems in VueJS development projects" can help you solve the problem.

1. Prompt "object does not support moveToElementText property or method" under KingEditor,IE

Solution:

The kingEditor I use is V4.1.10.

Modify the 5844 line of kingEditor.js:

If (_ IE) {var rng = cmd.range.get (true); rng.moveToElementText (div [0]); rng.select (); rng.execCommand ('paste'); e.preventDefault ();}

Modified to:

If (_ IE) {var rng = cmd.range.get (true); try {rng.moveToElementText (div [0]); rng.select (); rng.execCommand ('paste'); e.preventDefault ();} catch (e) {}}

Replace the kingEditor-min.js after compressing the kingEditor.js

Long string concatenation of 2.vue components

Long string concatenation is not compatible with ie, so string concatenation is required.

Post request for 3.axios.js.

Under chrome

Var newParams = new URLSearchParams (); newParams.append ('type',vm.typeNum); newParams.append (' num','20'); newParams.append ('curpage',vm.cur); axios.post (url,newParams). Then (function (res) {}) .catch (function () {})

Required under ie

Axios ({method: 'post', url:' / fhand apixis listCPN newsletter, data: {type: vm.typeNum, num: 4, curpage: vm.cur} TransformRequest: [function (data) {var ret =''for (var it in data) {ret + = encodeURIComponent (it) +' ='+ encodeURIComponent (data [it]) +'&'} return ret}] Headers: {'Content-Type':' application/x-www-form-urlencoded'}}) .then (function (response) {vm.articel_list = response.data.informations Vm.all = Math.ceil (response.data.totalnum/4);}, function (responese) {/ / console.log (responese);})

4. Under IE, prompt that "Promise" is not defined

Need to import polyfill.js file

This is the end of the introduction to "how to solve compatibility problems in VueJS development projects". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

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