|
生命周期的onMenuPress中写代码
- onMenuPress(){
- var that= this;
- prompt.showContextMenu({
- itemList: ['菜单一','菜单二','菜单三'],
- itemColor: '#444444',
- success: function(data) {
- if(data.index == 0){
- console.log("点击了菜单一")
- }else if(data.index == 1){
- console.log("点击了菜单二")
- }else if(data.index == 2){
- console.log("点击了菜单三")
- }
- },
- cancel: function(data) {
-
- },
- fail: function(data, code) {
-
- }
- });
- }
复制代码 |
|