uniapp 新增列表

需求:在小程序端动态增加列表值;

uniapp 新增列表_第1张图片

点击添加在顶部出现输入框

uniapp 新增列表_第2张图片

实现方式:

对列表重新定义赋值;

            //添加事件
			add() {
				var params = {
					names: null
				}
				// 解决添加时从上不添加,便于操作
                // 临时列表
				var tempList=[]
				tempList.push(params)
                // 拼接列表
				tempList=tempList.concat(this.workTypeVO.cvihWorkTypes)
                // 重新赋值给对象 this.workTypeVO 包含list列表的对象 
                //cvihWorkTypes 对象中列表对象名称,
                //tempList 临时新对象;
				this.$set(this.workTypeVO,'cvihWorkTypes',tempList)				
			}

你可能感兴趣的:(前端样式,vue部署,微信小程序,uni-app)