小程序关于vant-weapp弹框弹出问题

引入了vant-weapp但出现弹出框不弹出 编辑 删除选项卡
版本"vant-weapp": "^0.5.5"
如图所示:
8EBCC98FA1A3D0856B2B1FF68BF71486.png

**
feeditem.wxml代码如下:**

<!--components/feeditem/feeditem.wxml-->

<view class="scroll-view-item">

<view class="feedrow">

<view class="avatar"><image src="{{feeddata.user.avatar}}" mode="aspectFit" class="avatar-image"></image></view>

<view class="text">

<view class="userinfo">

<view class="user-left">

<view class="username">

{{feeddata.user.nickname}}<text class="uidspan">@u{{feeddata.user.id}}</text>

</view><view class="pubtime">{{time}}</view>

</view>

<view class="user-right">

<image src="/images/arrow.down@2x.png" mode="aspectFit" class="menu-icon" bindtap="toggle_menu" wx:if="{{feeddata.user.id == current_uid}}"></image>

</view>

</view>

<view class="content">{{feeddata.content}}</view>

<view class="actionbar"><image src="/images/retweet@2x.png" mode="aspectFit" class="action-icon"></image>转发</view>

</view>

</view>

<van-action-sheet

show="{{show_menu}}"

action="{{actions}}"

cancel-text="取消"

bind:close="onClose"

bind:cancel="onClose"

bind:select="onSelect"

/>

</view>

feeditem.js代码如下:

// components/feeditem/feeditem.js

import { format, render, cancel, register} from 'timeago.js';

import regeneratorRuntime from '../../utils/wxPromise.min.js';

Component({

/**

  * 组件的属性列表

  */

properties: {

feeddata:Object

},

/**

  * 组件的初始数据

  */

data: {

feeddata:null,

show_menu: false,

actions: []

},

lifetimes: {

attached(){

//  console.log("in item");

this.setData({

"time":format(this.data.feeddata.creatrd_at,'zh_CN'),

"current_uid": getApp().globalData.guid,

"actions": [

{ "name": "编辑", "action": "modify", "fid": parseInt(this.data.feeddata.id, 10) },

{ "name": "删除", "action": "remove", "fid": parseInt(this.data.feeddata.id, 10) }

],

});

},

},

/**

  * 组件的方法列表

  */

methods: {

timeago(string){

console.log("FFF");

},

onClose(){

console.log("inclose");

this.setData({"show_menu":false});

},

onSelect(e){

const fid = e.detail.fid;

const action = e.detail.action;

if( action == 'remove'){

console.log("remove"+fid);

wx.pro.requert({

url: '',

data: {'token': app.globalData.token,'id': fid} }).then(ret=>{

console.log(ret);

});

}

},

toggle_menu(e) {

this.setData({ "show_menu": !this.data.show_menu });

// 设置action

const fid = parseInt(e.detail.fid, 10);

const theaction = [

{ "name": "编辑", "action": "modify", "fid": fid },

{ "name": "删除", "action": "remove", "fid": fid }

];

this.setData({ "actions": theaction, "show_menu": true });

},

}

})

阅读 4.7k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题