摘要: 自定义组件直接加@click方法是不管用的,要加native <p><user-defined @click.native="add()"></user-defined></p>//加.native后add()方法才有用 阅读全文
posted @ 2019-11-12 18:49 lipu1993 阅读(793) 评论(0) 推荐(0)
摘要: :style="{'background-image':'url('+urlImg+')'}"//urlImg 一个动态提取的值 阅读全文
posted @ 2019-11-12 18:27 lipu1993 阅读(130) 评论(0) 推荐(0)
摘要: 按需加载路由可避免不必要的路由加载 新建router文件下movie文件 export default { path:'/movie', redirect:'/movie/nowPlaying', component:()=>import('@/view/movie'),//按需加载路由只在view 阅读全文
posted @ 2019-11-12 17:49 lipu1993 阅读(217) 评论(0) 推荐(0)
摘要: vue-router 的重定向-redirect 作用可使不同的路径都调回定向的页面 path:'/city', redirect:'/city/allCity',//重新定向输入 /city 依然会跳到/city/allCity 阅读全文
posted @ 2019-11-12 12:21 lipu1993 阅读(1720) 评论(0) 推荐(0)
摘要: 可以简单理解为computed给一个新的数据给你,但不污染data的数据 <div id="app"> {{PriceTest}} </div> <script> var app=new Vue({ el:'#app', data:{ price:100 }, computed:{ PriceTes 阅读全文
posted @ 2019-11-11 21:31 lipu1993 阅读(132) 评论(0) 推荐(0)
摘要: 关于手机端的屏幕适配问题,如果不允许缩放则需添加 <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">//user-scalable=no 不允许缩放 关于手机端的屏幕适配问题可 阅读全文
posted @ 2019-11-11 20:10 lipu1993 阅读(132) 评论(0) 推荐(0)
摘要: <router-link tag="li" to="/home"> <img src="@/assets/movie.png" alt> <p>电影</p> </router-link> <router-link tag="li" to="/city"> <img src="@/assets/Cit 阅读全文
posted @ 2019-11-11 18:11 lipu1993 阅读(525) 评论(0) 推荐(0)
摘要: 在你要使用插件的页面 import footerT from '@/components/footer/index.vue';//引入要使用的文件 import headerT from '@/components/header/index.vue'; export default { compon 阅读全文
posted @ 2019-11-11 17:35 lipu1993 阅读(1482) 评论(0) 推荐(0)
摘要: 遇到跨域的问题可在文件夹config中的index.js中进行设置 proxyTable: { '/api': { target: 'http://39.97.33.178',//要用到的地址 changeOrigin: true } }, 阅读全文
posted @ 2019-11-11 17:20 lipu1993 阅读(110) 评论(0) 推荐(0)
摘要: 1.不用纠结promise为什么是异步的问题,promise作为一个函数本身和同步异步没有什么关系,含有两个形参(resolve,reject),这两个形参都为函数,只是一般用来处理异步计算,它的作用是可以把异步的问题写的和同步一样。通过then()和catch()来解决异步处理问题,一般用于处理回 阅读全文
posted @ 2019-11-08 09:46 lipu1993 阅读(147) 评论(0) 推荐(0)