随笔分类 - vue
主要介绍vue项目中的一些方法
摘要:安装: npm install sm-cryptoOr yarn add sm-crypto sm2: 获取密钥对: const sm2 = require('sm-crypto').sm2 let keypair = sm2.generateKeyPairHex() publicKey = key
阅读全文
摘要:网址:https://501351981.github.io/vue-office/examples/docs/
阅读全文
摘要:在项目中使用el-dialog中发现不能够拖拽移动,因此网上找了相关资料,使用自定义指令实现拖拽功能。 1、创建自定义指令: 新建文件directive/el-drag-dialog/index.js import drag from "./drag"; const install = functi
阅读全文
摘要:问题: 日志打印的数据: 实际数据: 解决方案: 1、安装json-bigint: npm i json-bigint 2、引入使用 import axios from 'axios'import JSONbig from 'json-bigint' axios.defaults.headers['
阅读全文
摘要:问题:在form表单el-form中经常会出现表单条目比较多的问题,而且在提交的时候需要校验表单并且定位到相应的条目位置。 解决: html: <el-form ref="form" :model="form" :rules="rules" label-width="140px"> <el-form
阅读全文
摘要:使用vue-cli-service来构建一个vue应用程序,定义一些图标名称变量在.env文件中,需要在index.html中取到变量值。 如:在index.html我看到:<link rel="icon" href="<%= BASE_URL %>favicon.ico"> 首先我在.env 文件
阅读全文
摘要:1、引入zxing-js.,在uniapp中使用npm i @zxing/library --save这个方式引入依赖的话会存在报错 require is not defined,所以这里选择直接引入js文件; js地址:https://unpkg.com/@zxing/library@latest
阅读全文
摘要:实现方式:stringifyQuery 和 parseQuery // src\utils\encryption.js // 按需引入 CryptoJS 需要的组件 const CryptoJS = require("crypto-js/core"); const Latin1 = require(
阅读全文
摘要:html: <div class="home-main-dictum-info"> <span>{{ dictumInfo }}</span> <span class="home-main-typed-cursor" :class="{ 'is-typed-cursor-anmation': wat
阅读全文
摘要:新建组件: <template> <div class="table-container"> <el-table :data="tableData" width="100%" :height="height" :row-style="{ height: `${rowHeight}px` }" v-l
阅读全文
摘要:1、安装qrcodejs2 npm install qrcodejs2 / yarn add qrcodejs2 2、引入qrcodejs2 import QRCodejs from 'qrcodejs2'; 3、使用 html: <div ref="locatorQRCodeRef"></div>
阅读全文
摘要:1、通过id选择器来替换内容打印 html: <div ref="printQRCodeRef"> <div class="qrcode-dialog-container"> <img :src="locatorQRCodeDialogObj.qrcodeImgUrl" /> <div ref="l
阅读全文
摘要:需求:需要显示企业的关系图谱。(由于项目使用的Vue,所以感觉这个作者写的还不错) 1、安装relation-graph(http://relation-graph.com/): npm install --save relation-graph 2、引入relation-graph: import
阅读全文
摘要:问题起源: 近期在使用 elementUI 组件库中的Image组件时,其组件会自带一个图片预览功能,仅需要通过传入 preview-src-list (需要预览的图片url数组)即可实现预览。 代码如下(zIndex使用是由于我把这个功能放在弹框上面,所以需要加这个属性才不会被弹框遮挡): <el
阅读全文
摘要:1、创建loading.js import Vue from 'vue'; /** * 插入loading */ const insertDom = (el) => { let dom = `<div class="el-loading-mask"> <div class="el-loading-s
阅读全文
摘要:使用vue+elemen-ui开发 QuillEditor.vue <template> <div> <el-upload :action="uploadUrl" :before-upload="handleBeforeUpload" :on-success="handleUploadSuccess
阅读全文
摘要:html: <el-button type="primary" size="small" plain class="ml30" @click="_copy(details.id)">复制店铺ID</el-button> js: _copy(context) { // 创建输入框元素 let oInp
阅读全文
摘要:1、安装 weixin-js-sdk npm install weixin-js-sdk 2、引用 weixin-js-sdk const wx = require('weixin-js-sdk'); 3、结合后台传过来的参数 wx.config({ debug: false, appId: dat
阅读全文
摘要:在使用vue-seamless-scroll这个组件的时候发现存在一个问题: 自己写点击事件在滚动的项里面会自己复制一个dom出来,但是事件沒有复制出来。 解決方法: 我查看了很多文档,都是使用的事件代理;在自己需要点击的项中加一个class,在点击事件中用到。 上代码: <div class="b
阅读全文
摘要:这是正常赋值方式: this.form.startTime = item.warnValue.split('-')[0] this.form.endTime = item.warnValue.split('-')[1] 赋值已经成功,但是修改值的时候组件显示的值并没有修改. 修正后代码: this.
阅读全文