摘要:
white-space: nowrap; // 溢出部分隐藏 overflow: hidden; // 文字溢出用...替换 text-overflow: ellipsis; 阅读全文
摘要:
利用定时器防抖处理: //首先在 vdata 设置一个timerid的默认值 //在methods 利用定时器处理 input(value){ // 用定时器防抖 清除延迟器 clearTimeout(this.timer) this.timer= setTimeout(()=>{ // this. 阅读全文
摘要:
当弹出关闭,实例的弹窗还在, 可以在下面语句加个v-if='show' <van-popup v-model="show" v-if='show' position="top" :style="{ height: '30%' }" /> 阅读全文
摘要:
使用环境说明: 父子组件相互传值 父组件: <attention v-model="articlecontent.is_followed" :user_id="articlecontent.aut_id" /> 子组件: props:{ //这个参数接受的是接口内的关注的状态 value:{ typ 阅读全文
摘要:
<script> export default { name:"JSXFile", data() { return { msg: "消息", } }, methods:{ clickHandler(){ console.log("点击了"); this.msg="呵呵哒" } }, render() 阅读全文
摘要:
自定义全局指令方法一:(写入main.js 根文件中) Vue.directive("focus",{ inserted:function(ele){ ele.focus() } }) 方法二:(自定义一个js文件) 1.1自定义js文件: import Vue from "vue" //必须要有这 阅读全文
摘要:
准备工作:基础结构 <template> <div> <button @click="show = !show"> Toggle render </button> <!-- <transition name="slide-fade"> <p v-if="show">hello</p> </trans 阅读全文
摘要:
main.js 根文件: data() { return { rootMsg:"我是根实例" } }, methods:{ getmsg(){ return this.rootMsg } } APP.vue父级文件 data() { return { rootMsg:"我是APP例" } }, me 阅读全文
摘要:
动态组件准备工作 组件1:Acomponent内容部分: <template> <div>{{msg}}</div> </template> <script> export default { name:"Dynamic", data() { return { msg:"welcome 组件A!" 阅读全文
摘要:
父传子 1.父组件 <template> <div> <HelloWorld :msg="msg" v-model="number"></HelloWorld> </div> </template> <script> import HelloWorld from './components/Hell 阅读全文