摘要: elementui <el-upload class="upload-demo" action="/api-cdc/upload/attachment" ref="upload" :http-request="httpRequest" :on-preview="handlePreview" :on- 阅读全文
posted @ 2019-12-06 23:06 四海潮生 阅读(9521) 评论(0) 推荐(0) 编辑
摘要: 主要参考 https://blog.csdn.net/qq_37880968/article/details/94626001 1.添加模块 npm install --save html2canvas npm install jspdf --save 2.引入工具函数 import html2ca 阅读全文
posted @ 2019-12-06 22:48 四海潮生 阅读(2573) 评论(0) 推荐(0) 编辑
摘要: class绑定,内联样式 数组语法 :class="[stylename]" js:data{stylename:classname} 对象语法:class={stylename:true } 用vue-loader实现Scoped CSS 在组件的style标签,上使用scoped,在其中定义的样 阅读全文
posted @ 2019-12-02 22:35 四海潮生 阅读(896) 评论(0) 推荐(0) 编辑
摘要: 使用v-for遍历一个数组的时候,并且给定的数组变化时vue不会重复生成所有的元素,而是智能的找到需要更改的元素,并只改变这些元素 key属性可以告诉vue数组中的每个元素都应该与页面上的哪个元素相关联,key属性的默认值为元素再循环时的索引 需要注意的是,如果要删除数组中的元素,一般不要使用索引, 阅读全文
posted @ 2019-12-01 23:33 四海潮生 阅读(1102) 评论(0) 推荐(0) 编辑
摘要: 除了将数据作为prop传入到组件中,vue也允许传入HTML 父组件中的子组件:<custom-button>点我<custom-button/> custom-button子组件:<span> <slot></slot> </sapn> 会生成<span>点我</span> 不仅可以传入字符串,也 阅读全文
posted @ 2019-12-01 22:37 四海潮生 阅读(1994) 评论(0) 推荐(0) 编辑
摘要: 更详细的请查阅官方文档 https://github.com/lindell/vue-barcode vue-barcode是JsBarcode的一个简单包装。所以在使用时的配置属性需要在JsBarcode中查看 JsBarcode官方文档 https://github.com/lindell/Js 阅读全文
posted @ 2019-11-29 22:19 四海潮生 阅读(13480) 评论(0) 推荐(0) 编辑
摘要: html2canvas官方文档 http://html2canvas.hertzen.com/ npm下载依赖 npm install html2canvas -S 在需要使用的地方引入 import html2canvas from 'html2canvas'; 根据我司的需求,下载需要的html 阅读全文
posted @ 2019-11-29 22:00 四海潮生 阅读(9354) 评论(0) 推荐(0) 编辑
摘要: 单向数据流:数据通过prop从父组件传递到子组件中,当父级组件中的数据更新时,传子组件也会更新,但不能在子组件中修改。防止子组件在无意中修改,改变父级组件状态 然而,双向数据绑定在某些情况下有用。如果想要使用双向数据绑定,可以使用一个修饰符来实现:.sync修饰符。这只是一个语法糖 例:<count 阅读全文
posted @ 2019-11-27 23:01 四海潮生 阅读(2456) 评论(0) 推荐(0) 编辑
摘要: 传递数据 prop验证 除了传递数组,也可以传递对象 Vue.component('test',{ props:{ price:Number, unit: String } }) 如果price不是数字,vue就会抛出错误,prop可以是多个类型中的一个,可以为他传递一个包含所有有效类型的数组,例: 阅读全文
posted @ 2019-11-26 22:55 四海潮生 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 1.组件基础 通过import引入.vue的文件,在componet中注册,在template中使用。 2.数据,方法和计算属性 注意点: 因为组件是用来复用的,且 JS 里对象是引用关系,如果组件中 data 是一个对象,那么这样作用域没有隔离,子组件中的 data 属性值会相互影响,如果组件中 阅读全文
posted @ 2019-11-25 22:59 四海潮生 阅读(133) 评论(0) 推荐(0) 编辑