Vue.js

Impossible to convert html code to pdf with vue-html2pdf

假装没事ソ 提交于 2021-01-05 06:57:52
问题 I have a project in vuejs and I have to use vue-html2pdf. When i write a text in tag : <section>something</section> , my PDF is generated. But when i write in tag : <section><p>something</p></section> , my browser is crashed. Here my code in vuejs : <vue-html2pdf :show-layout="false" :preview-modal="true" :paginate-elements-by-height="10" :filename="test" :pdf-quality="2" :pdf-format="size" :ref="ref" > <section slot="pdf-content"> <section class="pdf-item"> <img :src=url> </section> <

Vue format date from DD-MM-YYYY to MM-DD-YYYY

淺唱寂寞╮ 提交于 2021-01-05 06:40:56
问题 I am new to Vue Js. I have added dropdown date using vue-date-dropdown . Currently the format for date dropdown is DD-MM-YYYY, is there a way to change it to MM-DD-YYYY? Package link for vue-date-dropdown = https://www.npmjs.com/package/vue-date-dropdown My View <b-form-group> <date-dropdown default="1993.02.27" min="1940" max="2020" :months-names="months" :format="'MM.DD.YYYY'" v-model="date_of_birth" id="dateDropdownDesign"> </date-dropdown> /** i tried to use :format date option , but it

Object is possibly 'null'. on a ref(null)

旧街凉风 提交于 2021-01-05 05:54:45
问题 Learning Vue Composition API (and TypeScript), from the docs I found, I should be using ref(null) to use by a sub component I have inside <template>...</template> . This subcomponent have methods like open() , and I'm accessing it like this: setup() { const subcomponentRef= ref(null); subcomponentRef.value.open(); return { subcomponentRef }; } This I agree may show the error Object is possibly 'null'. pointed to subcomponentRef.value , but the weird thing is even if I added a condition if

Object is possibly 'null'. on a ref(null)

大城市里の小女人 提交于 2021-01-05 05:51:48
问题 Learning Vue Composition API (and TypeScript), from the docs I found, I should be using ref(null) to use by a sub component I have inside <template>...</template> . This subcomponent have methods like open() , and I'm accessing it like this: setup() { const subcomponentRef= ref(null); subcomponentRef.value.open(); return { subcomponentRef }; } This I agree may show the error Object is possibly 'null'. pointed to subcomponentRef.value , but the weird thing is even if I added a condition if

How can I repeatedly access a Vue prop without tanking performance?

♀尐吖头ヾ 提交于 2021-01-05 05:46:40
问题 I'm working on a Vue/Vuetify app that has a performance problem. I've created a custom component that wraps around a standard Vuetify v-data-table component. It works fine for small amounts of data, but giving it moderate to large amounts of data causes Firefox to hang and Chrome to crash. Here's a slightly simplified version of my code: <script> import ... export default { props: { theValues: Array, // other props }, computed: { theKeys: function() { return this.schema.map(col => col.col); }

How can I repeatedly access a Vue prop without tanking performance?

巧了我就是萌 提交于 2021-01-05 05:45:29
问题 I'm working on a Vue/Vuetify app that has a performance problem. I've created a custom component that wraps around a standard Vuetify v-data-table component. It works fine for small amounts of data, but giving it moderate to large amounts of data causes Firefox to hang and Chrome to crash. Here's a slightly simplified version of my code: <script> import ... export default { props: { theValues: Array, // other props }, computed: { theKeys: function() { return this.schema.map(col => col.col); }

Vue系列(一)——初识Vue.js

非 Y 不嫁゛ 提交于 2021-01-05 01:52:12
Hello小伙伴们大家好,今天要开始Vue系列咯,那么就让我们一起走进Vue的世界吧~第一天让我们与Vue从相识开始。 01.Vue是什么 要问Vue是什么? 官方的说法就是是一套用于构建用户界面的渐进式框架,只关注视图层, 采用自底向上增量开发的设计,通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件。 感觉不太容易理解,我觉得翻译一下呢就是,用来写页面的一种框架,这种框架有这很简单的API能够帮助用户快速开发,然后使用MVVM的模式,使逻辑、视图分离的这么一个框架。 要说这框架好不好学,兔妞觉得,框架被编出来就是帮助开发者开发的,要是比原生的JavaScript还恶 心,谁还用它了,你说是不是,所以定是较原生简单的。 Vue最主要的几个特点就是: 1)MVVM模式 2)双向绑定 3)虚拟DOM 02.MVVM模式 这个图就是一个MVVM的模型,View指的就是视图层,主要用于表现DOM节点; Model 就是业务逻辑相关的数据对象,通常从数据库映射而来,我们可以说是与数据库对应的model ; ViewModel 就是与界面(view)对应的Model。因为,数据库结构往往是不能直接跟界面控件一一对应上的,所以,需要再定义一个数据对象专门对应view上的控件。而ViewModel的职责就是把model对象封装成可以显示和接受输入的界面数据对象, 它是Vue.js的核心

vue 查找数组对象某个字段的值并得到下标

穿精又带淫゛_ 提交于 2021-01-04 21:08:24
let ace = [{name:'111'},{name:'222'},{name:'333'}{name:'4444'}] let c1 = ( ace ). findIndex ((ace) => ace. name == '333' ); // 根据条件查找符号条件对象下标索引 console.log(c1) // 缩写判断是为了避免 值为 -1 时执行 splice ( c1 , 1 )从而会把数组中第一个值给截取掉 c1 === - 1 ? '' : item. children . splice ( c1 , 1 );// -1 就是没有找到不执行splice()截取操作,不为负-1 执行操作,splice方法返回截取后的新数组 来源: oschina 链接: https://my.oschina.net/u/4644439/blog/4877057

这 5 个能挣钱的 SpringBoot 项目,真TMD香!

点点圈 提交于 2021-01-04 17:21:47
关注我 们, 设为星标,每天7:30不见不散,架构路上与您共享 回复" 架构师 "获取资源 不得不佩服 Spring Boot 的生态如此强大,今天我给大家推荐几款 Gitee 上优秀的后台开源版本的管理系统, 小伙伴们再也不用从头到尾撸一个项目了,简直就是接私活,挣钱的利器啊 。 SmartAdmin 我们开源一套漂亮的代码和一套整洁的代码规范,让大家在这浮躁的代码世界里感受到一股把代码写好的清流!同时又让开发者节省大量的时间,减少加班,快乐工作,热爱生活。SmartAdmin 让你从认识到忘不了,绝对是你最想要的! 项目地址: https://gitee.com/lab1024/smart-admin litemall 又一个小商场系统,Spring Boot后端 + Vue管理员前端 + 微信小程序用户前端 + Vue用户移动端。 项目地址: https://gitee.com/linlinjava/litemall Timo TIMO后台管理系统,基于SpringBoot2.0 + Spring Data Jpa + Thymeleaf + Shiro 开发的后台管理系统,采用分模块的方式便于开发和维护,支持前后台模块分别部署,目前支持的功能有:权限管理、部门管理、字典管理、日志记录、文件上传、代码生成等,为快速开发后台系统而生的脚手架! 技术选型 后端技术

前端应届生如何做一个职业规划

℡╲_俬逩灬. 提交于 2021-01-04 15:34:58
前端的兴起 前端真正兴起和开始频繁出现在大家的视线里,大概是在十年前。彼时的 Web 开发基本是由后端主导,前端能做的只是校验一下数据、操作一下 DOM。(其中数据检验是 JS 产生的根本原因:当时网络太慢,在服务端检验数据并反馈给用户,让用户知晓输入错误,这个流程太长、反应太慢,因此通过脚本在用户端完成第一步校验,既方便了用户,又减轻了带宽的压力。)即使 06 年 jQuery 发布并风靡全球,以及 XMLHttpRequest 被纳入 W3C 标准,也没有改变这种状况。制约它进度的原因很简单,因为很多事情前端 做不了 或者 做不好。随着时间的推移,近几年,Angular、Backbone、React、Vue 等框架陆续发布,让前端越来越正规化、体系化。此时虽然仍有很多事,前端 做不了 或者 做不好,但前端这个岗位却已变得热辣空前。那么,是什么推动着前端发展到如此大的规模和火热的程度? 也许,你可以列举出很多各种各样的原因,但是综其一点,就是 『用户体验』 ,是由于所有人对用户体验的重视,才让前端发展得这么迅猛,这么快地兴起。这里,可能要感谢 Apple,感谢 iPhone,感谢 Jobs,07 年第一代 iPhone 发布,正式引发了几乎所有人对用户体验的重视,从『只要能用就好』,变成『要好用我才买单』的心理。而,前端的先驱者们、浏览器的开发者们,也顺应了这个潮流