- 昵称:51助手
- 博龄:5年5个月17天
- 粉丝:122
- 关注:108
- +关注
搜索
文章分类
博客档案
vue this.$refs的使用
摘要:一般来讲,获取DOM元素,需要使用document.querySelector('#input1')方法去获取dom节点,然后再获取input1的值。但是使用了ref绑定之后,我们就不需要再获取dom节点了,可以直接在上面的input上绑定input1,然后$refs里面调用就行。在JavaScript里面通过this.$refs.input
vue 微信分享 weixin-js-sdk
摘要:vue前端1 安装微信sdk weixin-js-sdknpm install weixin-js-sdk --save2 安装jquery 我用的是ajax发送请求npm install jquery --save我封装好的代码我放
vue滚动条事件,获取元素到底部距离
摘要:网上大部分vue的滚动条操作是监听dom实现,我是用@scroll实现首先有滚动条的div一定要设固定高度,然后overflow:auto;出现滚动条passive是使滚动更加流畅,减少卡顿<div @scroll.passive="getScroll($event)" style="height:10
tp5 当更新数库据影响行数为0时,事务没有回滚
摘要:tp5 sql语句没有出错,不是执行回滚解决方法,在每个sql数据执行返回结果,自已判断,返回错误结果// 启动事务 Db::startTrans(); try{ $mid = Db::name('goods_merchant')->insertG
vue 安装sortablejs 移动端拖动排序插件
摘要:插件地址:http://www.sortablejs.com/index.html vue 安装npm install sortablejs --save-devmounted() { $('.van-upload
Errors while compiling. Reload prevented.
摘要:百度查了很多方法都不对,仔细查看代码,发现模版html内容只能由一个div包含否则就会报错<template> <div class="html"> html内容
Unknown custom element: - did you register the component correctly? For recursive components, make sure t
摘要:vue 在使用vant form表单组件时报错,查看文档是没错的报错的大至意思是找不到<van-field> 这个组件解决方法:引入Field组件import {Field} from 'vant'Vue.use(Field);
vue 父组件向子组件传递点击事件
摘要:创建了一个子组件,子组件有自已默认的点事击事,当父组件传递点击事件时,则执行父组件点击事件案列:顶部导行条情况:当点击左箭点,判断父组件是否传递了点击事件,如果有就执行父组件的点击事件,如果没有,则默认执行子组件的点击事件子组件相关代码html <div class="topBar&
vue cookies使用说明
摘要:vue资源库中有个插件很好用vue-cookiesgithub地址:https://github.com/cmp-cc/vue-cookies使用起来也很方便,将vue-cookies.js 引入$cookies.config() 设置默认值this.$cookies.config(expireTimes,
vue 当图片地址为空或错误时显示默认图片
摘要:html代码<img :src="userInfo.headimgurl?userInfo.headimgurl:''" :onerror="defaultimg" />js代码computed: {