全部
常见问题
产品动态
精选推荐

点击修改规格属性

管理 管理 编辑 删除

目前是 只能新添加 和删除,不能修改原来已经添加的属性不怎么方便

于是就简单的修改了一下,(还有更好的方案就是直接在原来的规格上面输入)

懒得写css了 就这样吧简单点




\src\pages\product\productAdd\index.vue (这是 从商品列表 点 编辑 )

\src\pages\product\components\productDetails.vue (这是从商品列表 点 详情  右侧弹窗)

两个需要修改的地方 一模一样

		<!-- 可以搜索查找 handleRemove2 定位代码位置 -->
		
		<Col span="24">
		 <FormItem v-if="attrs.length !== 0">
		  <draggable class="dragArea list-group" :list="attrs" group="peoples" handle=".move-icon" :move="checkMove"
		    @end="end">
		    <div v-for="(item, index) in attrs" :key="index" class="acea-row row-middle mb10">
		      <div class="move-icon">
		        <span class="iconfont icondrag2"></span>
		      </div>
		      <div style="width: 90%" :class="moveIndex === index ? 'borderStyle' : ''">
		        <div class="acea-row row-middle">
			
		          <span class="mr5">{{ item.value }}</span>

		          <Icon type="ios-close-circle" size="14" class="curs" @click="handleRemoveRole(index)" />
		        </div>
		        <div class="rulesBox">
		
		     <draggable :list="item.detail" handle=".drag">
		         <Tag type="dot" closable color="primary" v-for="(j, indexn) in item.detail" :key="indexn" :name="j"
		             class="mr20 drag" @on-close="handleRemove2(item.detail, indexn)"   :style="indexn === Edit_index ? 'background: #e1f6ff !important' : ''">
		                  <span  @click.stop="setEdit(indexn)" >{{ j }}</span>
		         </Tag>
		     </draggable>
				
		          <Input v-if="!Edit"  search enter-button="添加" placeholder="请输入属性名称"  v-model="item.detail.attrsVal"
		            @on-search="createAttr(item.detail.attrsVal, index)" class="width-add" />
				
					
					
				<Input  v-else  search enter-button="修改" placeholder="请输入修改后的属性名称"  v-model="Edit_input"
				  @on-search="ok_Edit()" class="width-add" />	
				    <Button v-if="Edit" @click="on_Edit()"  style="margin-top: 10px;color: #888;background: #f5f5f5;">取消修改</Button>
			
					
		        </div>
		      </div>
		    </div>
		  </draggable>
		</FormItem>
		</Col>
		
         data() {
			   return {
                Edit:false, 
				Edit_index:'',
				Edit_input:'',//注意,逗号别漏了,下面省略号别管不用复制 表示 下面原来还有很多很多代码
				...........
				...........
	
		methods: {
	
	
			setEdit(indexn){
				this.Edit = true 
				this.Edit_index = indexn 
				this.Edit_input= this.attrs[0].detail[indexn] 	   
			},
			 
	ok_Edit() {
			let index = this.Edit_index
			let item = this. Edit_input
			this.attrs[0].detail.splice(index, 1, item)
			this.Edit = false
			this.Edit_index =''
	},
				
			on_Edit(){
				this.Edit = false
				this.Edit_index =''
			},//注意,逗号别漏了,下面省略号别管不用复制 表示 下面还有很多很多代码
			
	....................
	..................



\src\pages\product\components\productDetails.vue

这里还要在 关闭的时候  清除上一次的选中状态

<!-- 可以搜索查找 drawerChange(e) 定位代码位置 -->

    drawerChange(e) {

		this.Edit = false 
		this.Edit_index = ''
		................//省略号别管 不用复制 表示 下面原来还有很多很多代码
		...............


请登录后查看

浮云先生 最后编辑于2023-12-02 19:30:42

快捷回复
回复({{post_count}}) {{!is_user ? '我的回复' :'全部回复'}}
回复从新到旧

{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}

作者 管理员 企业

{{item.floor}}# 同步到gitee 已同步到gitee {{item.is_suggest==1? '取消推荐': '推荐'}}
{{item.floor}}#
{{item.user_info.title}}
附件

{{itemf.name}}

{{item.created_at}}  {{item.ip_address}}
{{item.like_count}}
{{item.showReply ? '取消回复' : '回复'}}
删除
回复
回复

{{itemc.user_info.nickname}}

{{itemc.user_name}}

作者 管理员 企业

回复 {{itemc.comment_user_info.nickname}}

附件

{{itemf.name}}

{{itemc.created_at}}   {{itemc.ip_address}}
{{itemc.like_count}}
{{itemc.showReply ? '取消回复' : '回复'}}
删除
回复
回复
查看更多
回复
回复
913
{{like_count}}
{{collect_count}}
添加回复 ({{post_count}})

相关推荐

浮云先生 作者
致命的老男人

回答

81

发布

10

经验

3738

快速安全登录

使用微信扫码登录
{{item.label}} {{item.label}} {{item.label}} 板块推荐 常见问题 产品动态 精选推荐 首页头条 首页动态 首页推荐
加精
取 消 确 定
回复
回复
问题:
问题自动获取的帖子内容,不准确时需要手动修改. [获取答案]
答案:
提交
bug 需求 取 消 确 定

微信登录/注册

切换手机号登录

{{ bind_phone ? '绑定手机' : '手机登录'}}

{{codeText}}
切换微信登录/注册
暂不绑定
CRMEB客服

CRMEB咨询热线 咨询热线

400-8888-794

微信扫码咨询

CRMEB开源商城下载 开源下载 CRMEB官方论坛 帮助文档
返回顶部 返回顶部
CRMEB客服