- 博客(6)
- 收藏
- 关注
原创 写在main.js里的混入方法写法
//在main.js里写混入方法function a() { Vue.mixin({ data:function (){ return { aaa:'LALALAL' } }, created: function () { console.log("每次开始前都用的混入方法",this.aaa) } } )}Vue.use(a)
2022-01-27 10:06:56
910
原创 VsCode快速生成模板
模板一:标准样式{ // Place your 全局 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope // is l
2022-01-12 14:46:26
594
原创 js的操作
//1.滚动到页面顶部const scrollToTop = () => window.scrollTo(0, 0);scrollToTop();//2.Javascript 反向字符串const stringReverse = str => str.split("").reverse().join("");stringReverse('hello world'); /*dlrow olleh*///3.删除数组中重复项const removeDuplicate =.
2022-01-07 12:30:28
402
原创 split(“?“)分割字符串
var data1 = { option_name: "部位", option_simple: "枕部^耳廓^肘部^骶尾部^踝部" } var sss = data1.option_simple.split("^") console.log("da", sss)for (let i = 0; i < sss.length; i++) { console.log("da", sss[i]) }分割完的内容添加到数组..
2021-09-11 14:01:46
140
原创 js中按照时间进行排序
var data = [{ name: "a1", time: "2017-08-18 13:23:21", }, { name: "a15", time: "2017-08-18 09:23:21", }, { name: "a51", time: "2017-08-18 02:23:21", }, { name: "a11", time: "2017-08-18 24:23:21"..
2021-09-10 10:23:42
4746
1
原创 浏览器网页的title离开当前页面和回来时的文字改变
写法一: document.addEventListener('visibilitychange', function () { // 页面变为不可见时触发 if (document.visibilityState == 'hidden') { document.title = '离开'; } // 页面变为可见时触发 if (document.visibilityState == 'visible') {
2021-09-10 09:27:32
503
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人