- 博客(14)
- 收藏
- 关注

原创 input框文件类型 图片展示
let reader = new FileReader()f = <input type="file">f.files : FileList {0: File, length: 1} 0: File {name: "1.jpg", lastModified: 1599530631124, lastModifiedDate: Tue Sep 08 2020 10:03:51 GMT+0800 (中国标准时间), webkitRelativePath:
2020-11-19 09:46:32
296

原创 如何使用mock.js模拟json数据并在简单的html页面使用
这个方法只适用于简单的html页面第一步:创建MockJson.js文件,在文件中存放json数据。Mock.mock( 'nav', { "data":[{"special":"专题","design":"设计,设计欣赏,好站推荐","course":"教程,网页制作,编程开发,图像处理","consult":"咨 询","homePage":"首页"}]})其中 nav是jso...
2019-11-17 21:44:52
1294
原创 Property or method “index“ is not defined on the instance but referenced during render
Property or method "index" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property
2022-11-02 09:37:43
4930
原创 git Updates were rejected because the tip of your current branch is behind 解决方案
Updates were rejected because the tip of your current branch is behind
2022-10-19 19:03:37
837
原创 SyntaxError: Unexpected token o in JSON at position 1 JSON.parse (<anonymous>)
Uncaught TypeError: Object(...) is not a function createPinia
2022-09-23 14:55:58
836
原创 vuex 为什么刷新页面后数据会丢失
vuex 数据存放在内存中,当你刷新页面后会重新加载页面,内存就会被释放,js垃圾回收原来localstorage 存在本地存储中
2021-07-22 10:49:01
259
原创 HTML文本中超出显示省略号
HTML文本中超出显示省略号HTML单行文本超出显示省略号HTML多行文本超出显示省略号单行文本超出省略号p{ overflow:hidden; text-overflow: ellipsis; //文本超出显示省略号 white-space:nowrap; //文本不换行}2.多行文本超出省略号p{overflow: hidden;在这里插入代码片text-overflow: ellipsis;white-space: nowrap;display:
2021-07-16 18:02:18
278
原创 Nuxt 中使用window document
在开发nuxt项目的时候,我们难免会使用到document来获取dom元素。如果直接在文件中使用就会报错。这是因为document是浏览器端的东西服务端并没有。解决方法:我们只需要在使用的地方通过process.browser/process.server来判断if (process.browser) { let myVideo = document.getElementById('mini_video'); if (myVideo) { if (!this.videoSh...
2021-07-16 09:58:44
1507
原创 解决npm ERR! Unexpected end of JSON input while parsing near的报错问题
执行 npm cache clean --force
2020-11-30 17:58:02
87
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人