vue methods 方法中 方法 调用 另一个方法。
vue在同一个组件内;
methods中的一个方法调用methods中的另外一个方法。
可以在调用的时候 this.$options.methods.test();
this.$options.methods.test2();一个方法调用另外一个方法;
new Vue({
el: '#app',
data: {
test:111,
},
methods: {
test1:function(){
alert(this.test)
},
test2:function(){
alert("this is test2")
alert(this.test) //test3调用时弹出undefined
},
test3:function(){
this.$options.methods.test2();//在test3中调用test2的方法
}
}
})
vue methods 方法中 方法 调用 另一个方法。的更多相关文章
- vue中methods一个方法调用另外一个方法
转自http://blog.csdn.net/zhangjing1019/article/details/77942923 vue在同一个组件内: methods中的一个方法调用methods中的另外 ...
- Don’t Use Accessor Methods in Initializer Methods and dealloc 【初始化和dealloc方法中不要调用属性的存取方法,而要直接调用 _实例变量】
1.问题: 在dealloc方法中使用[self.xxx release]和[xxx release]的区别? 用Xcode的Analyze分析我的Project,会列出一堆如下的提示:Inco ...
- html中引入调用另一个html的方法
html中引入调用另一个html的方法,尝试了好几种,都列出来: 其中第一种是最好的,其他的方法,可以尝试看看,是不是适合你当前项目 一.div+$("#page1").load( ...
- html中引入调用另一个公用html模板文件的方法
html中引入调用另一个公用html模板文件的方法 https://www.w3h5.com/post/53.html 这里我使用jquery的方法 <body> <div id=& ...
- @Transactional 同一个类中无事务方法a()内部调用有事务方法b()的问题
https://blog.csdn.net/u010235716/article/details/90171802 1. 事务的4种特性 序号 参数 含义1 原子性(Atomicity) ...
- Office word 2013中直接调用MathType的方法
Office word 2013中直接调用MathType的方法 | 浏览:4403 | 更新:2014-02-20 14:45 | 标签: word 使用Office word 2013的用户肯定早 ...
- CEF3中js调用delphi内部方法
2015-01-20修改:以下方法不适合delphi7,在CEF3源码中限制了delphi_14 up,对于被我误导的朋友说声抱歉 在CEF1中JS调用delphi的方法已经贴过:http://www ...
- vue.js---methods中一个方法调用另一个方法
new Vue({ el: '#app', data: { test:111, }, methods: { test1:function(){ alert(this.test) }, test2:fu ...
- Vue.js如何在一个页面调用另一个同级页面的方法
使用场景: 页面分为header.home.footer三部分,需要在home中调用header中的方法,这两个没有相互引入 官方给出方法: 需要在展示页里调用顶部导航栏页里的方法,两者之间没有引用关 ...
随机推荐
- 使用tinyxml2库解析xml
tinyxml2简介 tinyxml2是c++编写的轻量级的xml解析器,而且是开放源代码的,在一些开源的游戏引擎中用的比较多.源码托管在github上. 源码地址:https://github.co ...
- $.widget 编写jQueryUI插件(widget)
转自:MainTao: 编写jQueryUI插件(widget) 使用jQueryUI的widget来写插件,相比于基本的jquery插件有一些好处: * 方便实现继承,代码重用 * 默认是单例 * ...
- vue中makeMap方法的使用 (定义注册一些值 后期方便使用)
function makeMap ( str, expectsLowerCase ) { var map = Object.create(null); var list = str.split(',' ...
- php八大设计模式之适配器模式
将一个抽象被具体后的结果转换成另外一个需求所需的格式. 在生活中也处处有适配器的出现,比如转换头,就是让两种不同的规格合适的搭配在一起. <?php header("content-t ...
- Vijos 1071 && caioj 1411 动态规划2:打牌 (背包方案输出)
非常奇怪的是,我在Vijos 1071能AC,在caioj 就只有50分 可以和前面一道题一样算方案,如果大于1就是多解 然后就输出方案就好了 #include<cstdio> #incl ...
- CodeForces 363B Fence
Fence Time Limit: 1000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ...
- 国庆 day 6 上午
1. 角谷猜想(kakutani.pas/c/cpp)(kakutani.in/out)时间限制:1s/空间限制:256M[题目描述] 某个名字末尾是 654321 的小 A 同学是个大家眼中公认的学 ...
- ArcGIS Engine获得要素的中心点坐标
IPoint centerPoint =new PointClass();//获得要素的中心点 IArea pArea = pFeature.Shape as IArea; pArea.QueryCe ...
- POJ 3670 Eating Together(LIS)
Description The cows are so very silly about their dinner partners. They have organized themselves i ...
- Can’t connect to local MySQL server through socket ‘/tmp/mysql/mysql.sock’解决方法
原因在于/tmp/mysql/mysql.sock不存在,为/usr/local/mysql/mysql.sock建立一个软连接到/tmp/mysql/mysql.sock即可. ln -s /usr ...