原创 vue使用一些方法

1、輸入框只能輸入數字和小數點 // 只能輸入數字和小數點 onlyNumber(key){ this.formDatas[key]=this.formDatas[key].replace(/[^\d.]/g,''); }

原创 elementUI表單驗證

1、js import store from '@/store' // 自定義驗證條件 // 手機號驗證規則 const verifyPhone=(str)=>{ const reg=/^1\d{10}$/; r

原创 uni-app公用方法

basic.js import Vue from 'vue' import store from '@/store' 1、運行環境判斷 if(process.env.NODE_ENV == 'development'){ //

原创 uni-app全選和取消全選

此方法使用 ColorUI 作爲基礎樣式,所以複選框切換要改變相應的類才能正確展示。 <template> <view> <!-- 單個複選框 --> <checkbox-group class="block" @cha

原创 VUE3.0項目配置

1、項目結構 ┌─dist 生產打包輸出目錄 ├─node_modules 模塊依賴包 ├─public 靜態html和網站圖標 ├─s

原创 ES6擴展方法

1、格式化時間 /* 保留兩位小數 * @method fixed2 * @param {String} str 需要轉換的字符串 * @return {String} 返回兩位小數 */ const fixed2=(str

原创 axios請求方法二次封裝

requestMessage.js /** * @Descripttion: axios和操作提示的二次封裝 * @Author: lgen */ import Vue from 'vue' import axios

原创 uni-app多個輸入框帶清除按鈕

<template> <view> <view class="uni-form-item uni-column"> <view class="title">多個輸入框都帶清除按鈕</view> <view v-f

原创 window.open被瀏覽器阻止的問題

解決ajax異步請求之後,window.open被瀏覽器阻止的問題 // 點擊時候先打開空白頁面 var newWin = window.open(); newWin.document.body.innerHTML="正在加載中.

原创 uni-app動態設置導航欄搜索框內容

// 動態設置導航欄搜索框內容 const setNavSearchInput=(keyword)=>{ // #ifdef APP-PLUS let webView = this.$mp.page.$getAppWebvie

原创 js面向對象拖拽

drag.js實現拖拽,沒有控制邊界,使用dragLimit.js繼承drag.js再實現了邊界控制 drag.html <!DOCTYPE html> <html lang="en"> <head> <meta char

原创 字符搜索

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>字符搜索</title> </head> <body> <input type="tex

原创 mysql常用操作

添加一條數據 INSERT INTO tableName(`title`,`desc`,`add_time`)VALUES('測試','這是一個測試內容',UNIX_TIMESTAMP()) 插入時間戳 UNIX_TIMESTAMP

原创 CSS常用樣式

圖片垂直居中 .img-box { height: 130px; line-height:130px; } img { vertical-align: middle; } 垂直居中,不知道自己高度和父容器高

原创 jq生成二維碼

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>生成二維碼</title> <script type='text/javascript'