- 博客(6)
- 收藏
- 关注
原创 基于html2canvas+jspdf实现html页面转pdf
基于html2canvas+jspdf实现html页面转pdfimport html2canvas from "html2canvas";import JsPDF from "jspdf";/** * path: src/utils/htmlToPdf.js * name: 导出页面为pdf格式 */const htmlToPdf = { getPdf(title) { html2canvas(document.querySelector("#pdfDom"), {
2021-08-02 16:43:48
368
原创 vue中watch深度监听
vue中watch深度监听方式一:export default { data() { return { a: { b: { c: '123' } } } }, watch: { // 深度监听c 'a.b.c': function(newValue, oldValue) {} }}方式二:export default { data() { return {
2021-06-11 15:10:54
162
1
原创 vue解决跨域之配置proxy代理
vue解决跨域之配置proxy代理由于服务器端发起请求不受跨域影响,因此可以通过服务器代理的方式解决跨域问题vue.config.jsmodule.exports = { devServer: { // 配置proxy服务器代理 proxy: { // 以/api开头的地址 将会请求target地址 '/api': { target: 'http://xxx.xx.xxx.xxx', changeOrigin: true,
2021-06-11 14:52:14
382
1
原创 vue项目中的axios配置与api模块化管理
vue项目中的axios配置与api模块化管理1.目录结构:在src目录下新建apis文件夹,用于配置项目中的api接口2.配置开发环境与生产环境的请求根路径baseUrlconfig.js// 生产环境const prodConfigs = { apiHost: 'http://localhost:8000', staticHost: ''}// 开发环境const localConfig = { apiHost: 'http://localhost:4000', sta
2021-06-11 10:12:55
572
1
原创 Vue 子组件调用父组件中的方法
Vue 子组件调用父组件中的方法1.通过this.$parent.event调用父组件中定义的方法子组件<template> <div id="son"> <h6>子组件</h6> <button @click="childMethod()">$parent方式调用父组件方法</button> </div></template><script>export def
2021-06-10 00:24:47
292
2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人