• Welcome to the eight year blog, I'm glad to meet you at the right age!
  • Due to the theme, QQ login partners will display the default avatar in the comments. Please go to the personal center and upload the avatar again.

JS matches the style in HTML tags

 JS matches the style in HTML tags
There is a news content module in the project, which is HTML text from the back end. I decided to render it with v-html in the front end. However, rendering the style tag directly on this page is really ridiculous! 用正则匹配html标签里的style并使用replace删除 let content = "<p style='color: #00afef;'>下次一定</p>"; co ... Read the full text

barben 2 months ago (10-09) 133 view 0 comments ten Praise

Convert JS timestamp to normal digital time format

 Convert JS timestamp to normal digital time format
On the interface in the middle of the night, I found that the time field passed to me by a good person in the back end was actually in the format of timestamp??? originally, I wanted the back end to change this timestamp to a value that can be seen by a man in the sun, but when I look at the time . 2020-09-20 02:06:05 excuse me, I will come by myself!!!! function getdate(time) { var now = new Date(time), y = now ... Read the full text

barben 09-2 months ago 226 view Comments 0 fifteen Praise

Van re rendering updates picker view

 Van re rendering updates picker view
One requirement is to use van's picker selector component instead of the input box to set everyone's score. however, the score of each item is different. Some items have a full score of 10 points, while others have a full score of 30 points. Therefore, it is necessary to dynamically change the optional range for picker selectors. Score selection pop-up window > Read the full text

barben 3 months ago (09-11) 342 browse 0 comments six Praise

How to remember JS data type in short time?

 How to remember JS data type in a short time?
If you can remember the data type of JS in one sentence, you are really a U so NB! I like to use it instead of you, which means you. So, so, very, very You don't need me to talk about it. Of course, it's cattle criticism!!! The ones that start with u are undefined > > the ones with s start with string and ES6, and the new symbol > the ones that start with o have objects. There are two objects that start with N, numb Read the full text

barben 3 months ago 188 browse 0 comments twenty-two Praise

Vue encapsulates Axios

 Vue encapsulates Axios
And the previous article "wechat applet encapsulates request" very similar to the single door for loop writing The advantages are really clean ~ 1. Create two new files to encapsulate Axios and manage interfaces. Here, I create a new index. JS and apilist. JS under Src / assets / JS / API. In index. JS, encapsulate Axios: import Axios from 'Axios' Read the full text

barben 6 months ago (06-05) 492 browse 0 comments two Praise

Vue modularizes data, such as element form verification

 Vue modularizes data, such as element form verification
Why modularize data? when using the form component of element today, I saw that the form verification rules were written in piles under the data of the page, which was very messy. so I wonder, can we put all the rules of form verification together to facilitate management? So I did these things create a new JS file you can put this JS file anywhere you want in the project. Then in this JS file, write your data and use export default to set the number Read the full text

barben 6 months ago (05-29) 342 browse 0 comments eight Praise

Vue using sass in uni app

 The use of VUI in appvue
1. First of all, you need to install node sass, because sass loader depends on it NPM install node sass -- save dev 2, install sass loader NPM install sass loader -- save dev 3. Modify the style label to declare the use of SASS < style lang = "SCSS" scoped > < / St Read the full text

barben 7 months ago (05-13) 904 browse 0 comments ten Praise