随笔分类 - vue
摘要:返回顶部 <template> <div> <!--返回顶部按钮--> <div style="position: fixed;bottom: 100px;right: 50px;"> <i v-if="btnFlag" @click="backTop" class="back-wrap"></i>
阅读全文
摘要:动态组件:让多个组件使用同一个挂载点,并动态切换,这就是动态组件 <div id="example"> <button @click="change">切换页面</button> <component :is="currentView"></component> </div> <script> va
阅读全文
摘要:使用vue-touch步骤 npm install vue-touch@next --save //在vue项目中的main.js文件中引入:import VueTouch from 'vue-touch'Vue.use(VueTouch, {name: 'v-touch'}) <v-touch v
阅读全文
摘要:组件内守卫 const Foo = { template: `...`, beforeRouteEnter(to, from, next) { // 在渲染该组件的对应路由被 confirm 前调用 // 不!能!获取组件实例 `this` // 因为当守卫执行前,组件实例还没被创建 }, befo
阅读全文
摘要:父组件向子组件传值 父组件 <template> <div id="app"> <mailTable :father="father"></mailTable> </div> </template> <script> import mailTable from '../utils/table' ex
阅读全文