原创 頁面全屏&退出全屏 React js

import React, { Component } from 'react' export default class FullScreen extends Component { toggleFullScreen() {

原创 antd react 郵箱地址補全

import React, { Component } from 'react' import { AutoComplete } from 'antd' const { Option } = AutoComplete expo

原创 react 截取字符串自定義字符的前後內容

在上傳附件的時候,有時候文件名會過長,需要處理一下,效果如下: import React from 'react' class Resume extends React.Component { state = { fi

原创 獲取滾動條位置(兼容Edge)

衆所周知,要獲取當前頁面的滾動條縱座標位置,用: document.documentElement.scrollTop; 但是 在標準w3c下,document.body.scrollTop恆爲0,需要用document.doc

原创 wangEditor3 React 上傳圖片

官網地址: https://www.kancloud.cn/wangfupeng/wangeditor3/332599 首先,在 React 項目中安裝 wangEditor3 插件 npm install wangedit

原创 手機端選擇照片和調用攝像頭,錄音,文件類型

<input type="file" accept="image/*"> <!--*可改爲圖片類型,如jpg,png等,中間用逗號隔開,image/ jpg,image/png---> <!--*調用攝像頭---> <input

原创 vue打包時背景漸變失效

vue打包時會把谷歌的漸變兼容性過濾掉,需要加上下面的代碼纔不會被過濾。 /*! autoprefixer: off */ background:-webkit-gradient(linear, 100% 0, 0 0, from(r

原创 vue tab選項卡

選項卡在實際項目中還是會經常運用到的,非常簡單,但也記錄下。因業務上的選項卡內容還是比較多的,所以父組件引入子組件的方式來實現。 首先新建一個父組件,如下: <template> <div class="service">

原创 vue 下載文件

<templete> <span @click="download(contract.filePath)">下載</span> </templete> <script> module.exports = { methods:

原创 vue-swpier 實現三級聯動選擇省,市

項目中需要用到三級聯動選擇省份+城市。因項目中已用到swiper組件,遂選擇了swiper來做三級聯動功能,避免重複贅餘,節省代碼量。話不多說,直接上代碼。如有不明白的地方,可留言。看到會回覆的,望對諸位有所幫助。 1.安裝swipe

原创 關於地址欄的一些小事

獲取地址欄的鏈接 document.location.href z 獲取地址欄的域名 document.location.host 或者 location.origin 獲取地址欄的域名下的相對路徑 location.pathn

原创 判斷ios和安卓系統,pc和手機端

判斷ios和安卓系統 var u = navigator.userAgent, app = navigator.appVersion; var isAndroid = u.indexOf('Android') > -1

原创 vue 微信分享

vue 微信分享 參考資料微信JS-SDK說明文檔 業務邏輯: 需完成微信朋友圈和微信好友分享,後臺返回signature,其他參數需本前端萌萌定義 前期工作 1.安裝微信開發者工具 爲方便以後開發debug,可以安裝微信開發者工具

原创 圖片放大鏡

效果 所需圖片 pic爲同一張圖 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="Content

原创 刪除&添加行列

效果 html <div class="g-clr"> <table class="table_dimension"> <tr> <td>尺碼</td> <td