1.html,通过ref=replyBox设置焦点元素,以便后续获取 // 动态设定自动获取焦点按钮 <p class="text-right text-blue fts14 ptb10 pointer" @click="replySet(comment,comment,1,index)" v-if="comment.replyList && comment.replyList.length > 0">我要回复&…
鼠标经过INPUT时自动获取焦点 <input type="text" name="addr" onMouseOver="this.focus()" />…
第一种方法 npm install vue-wechat-title --save 在mian.js中引入 //设置title import VueWechatTitle from 'vue-wechat-title' Vue.use(VueWechatTitle) 在router的index.js的路由中加上参数 { path: '/login', component: Login, meta: { title: '登录' } } 如果是公共组件,在跳转时根据条件来动态设置title,可以在最…
需求: slider侧边栏是宽度是动态的,使用jquery可以操作dom元素,设置宽高,但vue是避免操作dom的 <template> <div class="slider"> <h1>Hamy</h1> </div> </template> <script> export default{ name:'index', data(){ return{ sliderStyle:{ width:'240p…
  大多数情况vue项目中组件是需要相互引用的,父组件引用子组件,子组件引用父组件,已达到组件重用的目的   本次记录的是父组件引用子组件,img标签定义在多个子组件中,不同或相同的父组件引用同一个子组件,从而设置不同的图片路径 1.子组件实现 <div class="customerIntroduce-left"> <!-- 父组件传入图片路径 --> <img :src=image_path /> </div> export defa…
<div class="tab"> <navigator :class="currentTab=='mzfw'?'nav active': 'nav'" data-id="mzfw" @click="switchTab('switchTab',$event)" open-type="navigator" url="">门诊服务</navigator>…
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" con…
只要在该input标签后添加autofocus="autofocus"即可 代码实例: <html> <head></head> <body> 用户名:<input type="text" id="username" name="username" autofocus="autofocus"/><br/> 密码:<input ty…
<html>    <head></head>    <body>        用户名:<input type="text" id="username" name="username" autofocus="autofocus"/><br/>        密码:<input type="text" id="passw…