- 博客(23)
- 收藏
- 关注
原创 vue+element图片上传服务器
<el-upload v-model="imgs5" action="https://jsonplaceholder.typicode.com/posts/" list-type="picture-card" :on-remove="removeHandle5" :on-change="changeHandle5" auto-upload="false" :file-list="listA5" :limit="1"> <i slot.
2022-03-26 09:47:47
777
1
原创 vue+element表头&行合并
效果图 优化合并表头循环(推荐) span-method:合并行或列的计算方法 <template> <div> <!-- 表 --> <el-table :data="tableData" border ref="ref-table" :height="tableHeight"
2022-03-08 17:33:46
931
原创 uniapp的使用
1安装uni-uinpm i @dcloudio/uni-ui 或 yarn add @dcloudio/uni-ui//sass-loader 请使用低于 @11.0.0 的版本,sass-loader@11.0.0 不支持 vue@2.6.122.局部引入组件 3.注册组件import {uniBadge} from '@dcloudio/uni-ui'//import uniBadge from '@dcloudio/uni-ui/lib/uni-badge/uni-
2022-03-08 14:10:29
268
原创 vue中el-table分页
<el-table :data="dataSource.slice((currentPage-1)*pageSize,currentPage*pageSize)" style="width: 100%">.....</el-table> <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :curr.
2022-03-04 16:04:39
515
原创 vue中input最大输入限制
<el-input v-model="form.flname" v-decorator="['customerPhone',{rules: []}]" placeholder="请输入商家分类名字" :maxLength="4" style="width: 300px" ></el-input>为啥文章质量不佳为.
2022-03-04 14:27:10
940
原创 vue导出Excel表格,utils未定义是版本原因
1,安装依赖包npm install --save xlsxnpm install --save file-saver如果报"TypeError: Cannot read properties of undefined (reading 'utils')"utils未定义的话需要换一下版本npm install --save xlsx@0.17.0npm install --save file-saver@2.0.52.给表格添加ref属性<table ref="ex
2022-03-03 16:50:05
5274
7
原创 React组件深入props
// children属性 文本节点// const App = props => {// console.log(props);// return (// <div>// <h1>组件标签的子节点:</h1>// {props.children}// </div>// )// }// reactDom.render(<App>我是子节点</App>,document.getEl.
2021-12-02 10:13:30
799
原创 React组件的Context,跨组件传递数据
// 创建context得到两个组件const {Provider,Consumer} =React.createContext()class App extends React.Component{ render () { return ( <Provider value="pink"> <div> <Node /> </div> </Provider> ) }}const No.
2021-12-01 17:18:41
757
原创 组件之间的通讯,props
组件的props 接受传递给组件的数据// 组件的props// 函数组件接收数据// const Hello = (props) => {// // props是一个对象// console.log(props);// return (// <div>// <h1>props:{ props.name }</h1>// </div>// )// }// // 传递数据// 类组件传递..
2021-11-30 10:39:08
365
原创 React表单处理
1.受控组件// 受控组件class App extends React.Component { state = { txt:'' } handleChange = (e) => { this.setState({ txt:e.target.value }) } render () { return ( <input type="text" value={this.state.txt} onChange={this.handleChange}>
2021-11-23 16:46:11
328
原创 React组件
使用react就是在使用组件1.函数创建组件 函数名开头字母必须大写 ,函数组件必须有返回值// 函数组件// function Hello () {// return (// <div>这是第一个函数组件</div>// )// }const Hello=()=> <div>这是第一个函数组件</div>ReactDOM.render(<Hello/>,document.getElementById(..
2021-11-18 14:37:08
290
原创 React中JSX的使用
1.使用jsx创建react元素2.使用ReactDOM.render()方法渲染元素// 创建react元素const title = <h1>hello jsx <span>这是span</span> </h1>// 渲染react元素ReactDOM.render(title,document.getElementById('root'))3.推荐使用()小括号包裹jsx代码4.嵌入js表达试 使用单大括号{ }...
2021-11-18 10:56:15
989
原创 react脚手架的使用
开源一次,随处使用,开源即用无需配置1.初始化项目 npxreact-app 项目名字2. 启动项目 npm start3. index.js文件夹中导入 react 和 react-dom 两个包import React from 'react'import ReactDOM from 'react-dom'4.创建react元素和渲染react元素React.createElement()方法,用来创建元素ReactDOM.redder()方法用来渲染元素//...
2021-11-18 09:26:04
465
原创 vue,js中el-input实现模糊查询
searchmohu () { // 模糊查询 this.tableData.map((msg) => { //拿当前json的cpmc去分别跟输入的值进行比较 //indexOf 如果在检索的字符串中没有出现要找的值是会返回-1的,所以我们这里不等于-1就是假设输入框的值在当前json里面找到的情况 if (msg.cpmc.indexOf(this.value2) != -1) { // 把之前的数据情况.
2021-10-28 15:10:58
1074
2
转载 Node Sass version 6.0.1 is incompatible with ^4.0.0.
node-sass 6.0.0版本与^4.0.0不兼容1、先卸载之前版本的node-sassnpm uninstall node-sass2、卸载后安装4.0.0版本npm install node-sass@4.14.1这里可能会失败,原因是你安装的淘宝镜像的问题。如果失败了就重装淘宝镜像npm install -g cnpm --registry=https://registry.npm.taobao.org重装后重新执行第二步操作即可npm install node-sass@
2021-10-13 11:37:56
724
原创 js获取日期中的年月日星期
var today = new Date()var years = today.getFullYear();//年var months = today.getMonth();//月份从0开始var d = today.getDate();//日期var h = today.getHours();//小时var m = today.getMinutes();//分钟var s = today.getSeconds();//秒var w = today.getDay();//星期从0开始var.
2021-10-12 15:59:14
241
原创 vue,js根据字段进行排序
1.methods方法 如果为日期把Number换成Date.parsetopSort (a, b) { return Number(b.nTop) - Number(a.nTop);},// nTop为字段 a,b为顺序2.调用topStort方法使用stort进行排序 res.sort(this.topSort); //res为数组,及获取后端的数据 进行排序...
2021-10-12 15:55:39
544
转载 Js数组对象去重的几种方法
arr: [ { id: 1, name: 'a' }, { id: 1, name: 'f' }, { id: 2, name: 'b' }, { id: 3, name: 'c' }, { id: 3, name: 'g' }, { id: 4, name: 'd' }, { id: 5, name: 'e' }, ],方法一:双重for循环deweight() { .
2021-10-12 15:46:44
690
原创 js将数组转为字符串用逗号隔开,字符串转数组
1.数组转字符串 let list = [1,2,3,4,5,6]; list.join(","); console.log(list); // 打印结果:"1,2,3,4,5,6"2.字符串转数组var text = "1,2,3,4,5";var array = text.split(",");//逗号是分隔符var array = text.replace(/\"/g, "");...
2021-10-12 15:40:44
5918
原创 vue实现每个逗号换行一次,每两个逗号换行一次
每个逗号换行一次vue代码<td v-html="cutout(item.sMonday)"></td>methods代码cutout (cellValue) { return cellValue.replace(/\,/g, '</br>') },每两个逗号换行一次vue代码<td v-html="cutout(item.sMonday)"></td>methods代码cutou...
2021-10-11 09:40:14
1169
1
原创 js,vue获取本机内网ip地址
在谷歌浏览器中获取ip地址后会出现一串乱码,谷歌某个版本之后需要修改谷歌的配置1.在chrome 浏览器地址栏中输入:chrome://flags/2.搜索#enable-webrtc-hide-local-ips-with-mdns该配置 并将属性改为disabled3.js实现代码...
2021-10-11 09:26:13
1322
原创 vue导出表格成Excel文件
导出表格1.安装依赖npm install --save xlsxnpm install --save file-saver2.表格添加ref属性<table ref="refs"> ... </table>3.js实现代码// 导入依赖import XLSX from 'xlsx'import FileSaver from 'file-saver'// 导出方法exportBtn() { // 获取表格元素 const el = thi..
2021-10-11 09:17:25
97
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅