vue 学习 二
2024-09-06 07:23:47
动画
<transition name="fade">
<p v-if="show">hello</p>
</transition> 如果你使用一个没有名字的<transition>
,则v-
是这些类名的默认前缀。如果你使用了<transition name="my-transition">
,那么v-enter
会替换为my-transition-enter
使用axios
安装:cnpm install axios
使用:
main.js
import axios from 'axios'
Vue.prototype.$ajax = axios
不能使用vue.use(axios),会报错
组件中使用:
this.$http.get('http://cangdu.org:8001/v1/cities?type=group')
.then(function(response){
console.log(response);
})
.catch(function(error){
console.log(error);
});
事件绑定:
在 Vue 2.0 中,为自定义组件绑定原生事件必须使用 .native
修饰符:
<my-component @click.native="handleClick">Click Me</my-component>
从易用性的角度出发,mintui对 Button
组件进行了处理,使它可以监听 click
事件:
<mt-button @click="handleButtonClick">Click Me</mt-button>
但是对于其他组件,还是需要添加 .native
修饰符。
最新文章
- 球谐光照(Spherical Harmonics Lighting)及其应用-实验篇
- Win8怎么查看IP地址
- HDU 5724 Chess(国际象棋)
- angularJS项目-ajax事件的按钮loading和页面loading状态 &; Controller之间通信-待续
- SlideLayout
- 字符串逆转(递归和非递归java)
- xcode 环境,多工程联编设置【转】
- chorme调试Paused in debugger问题解决
- 线性表->;顺序存储
- 开发Canvas 绘画应用(三):实现对照绘画
- Linux下docker报错syntax error:unexpected protocol at end of statement
- mui 对话框 点击按钮不关闭对话框的办法
- Windows上搭建安卓的Java开发环境
- SSM获取表单数据插入数据库并返回插入记录的ID值
- Python 全栈开发六 常用模块学习
- Solr系列一:Solr(Solr介绍、Solr应用架构、Solr安装使用)
- oops_根据epc定位linux_kernel_panic位置
- Tiny microcontroller hosts dual dc/dc-boost converters
- Go语言中字符串的查找方法小结
- Effective Java-第4章
热门文章
- Altera: set pin locations using tcl
- LUOGU P4322 [JSOI2016]最佳团体(0/1分数规划+树形背包)
- ajax跨域获取网站json数据
- Android问题集锦An error occurred while automatically activating bundle com.android.ide.eclipse.adt .
- EXCEL函数常用技巧浅析
- jeecms jeecmsv93建库
- HDU-2095-find your present (2)-位或/STL(set)
- Java 内部类,成员类,局部类,匿名类等
- 19.SimLogin_case06
- 第三周课堂笔记1thand2thand3th