随笔分类 - Vue
摘要:Vue - 实现穿梭框功能 css .transfer{ display: flex; justify-content: center; align-items: center; } .transfer>.list { width: 200px; height: 300px; border: 1px
阅读全文
摘要:一:使用window对象的onbeforeunload方法 mounted () { window.onbeforeunload = function (e) { var message = 'some word'; e = e || window.event; if (e) { e.returnV
阅读全文
摘要:Vue 实时获取屏幕宽高 export default { name: 'page-index', data(){ return{ windowWidth: document.documentElement.clientWidth, //实时屏幕宽度 windowHeight: document.d
阅读全文
摘要:Vue实现页面刷新 普通方法: location.reload(); this.$rotuer.go(0); 这两个方法会强制刷新页面,出现短暂的空白闪烁 使用 provide和inject 这对选项需要一起使用,以允许一个祖先组件向其所有子孙后代注入一个依赖,不论组件层次有多深,并在起上下游关系成
阅读全文
摘要:Vue.component使用 一: 新建一个 component-moke1.vue 文件 <template> <div class="component-moke1"> 子组件 componentmoke1 </div> </template> <script> </script> <styl
阅读全文
摘要:Vue Vue实例有一个完整的生命周期,也就是说从开始创建、初始化数据、编译模板、挂在DOM、渲染-更新-渲染、卸载等一系列过程,我们称为Vue 实例的生命周期(钩子函数) 附上网上找的一张图解释当我们 new vue 的时候,这些函数就会自动执行 生命周期钩子: 创建:beforeCreate -
阅读全文

浙公网安备 33010602011771号