当前位置:网站首页>关于组件传值
关于组件传值
2022-06-12 16:15:00 【努力努力再努力U】
result = result.map((item) => {
return {
values: {
shopImg: item.returnRequestEntryDTOList[0].picUrl,
},
...item,
};
});
<wxs src="./index.wxs" module="computed" />
<view class="card-main content-class" wx:if="{
{useMain}}">
<view class="card-left">
<view class="card-img-box">
<image
catch:tap="handleClickImg"
lazy-load="{
{true}}"
class="card-img"
src="{
{computed.getters('shopImg',values,valueMap,useMap)}}"
data-url="{
{computed.getters('shopImg',values,valueMap,useMap)}}"
data-imgs="{
{computed.getters('imgs',values,valueMap,useMap)}}"
mode="widthFix"
/>
<view class="content-class-explosion" wx:if="{
{explosionText}}">{
{explosionText}}</view>
</view>
<view class="card-name-box">
<slot name="info" wx:if="{
{useInfoSlotMain}}"></slot>
<view class="card-name" wx:else>{
{computed.getters("shopName",values,valueMap,useMap)}}</view>
<slot name="code" wx:if="{
{useCodeSlotMain}}"></slot>
<block wx:else>
<view class="card-number">{
{mainTitle}}{
{computed.getters("shopCode",values,valueMap,useMap)}}</view>
<view class="card-number">{
{purchaseAgent}}{
{computed.getters("purchaser",values,valueMap,useMap)}}</view>
<view class="card-number">{
{purchaseAccount}}{
{computed.getters("purchaseNumber",values,valueMap,useMap)}}</view>
</block>
</view>
</view>
<view class="card-right content-price-class">
<view class="card-price">{
{computed.getters("shopPrice",values,valueMap,useMap)}}</view>
<view class="card-num">{
{computed.getters("shopNum",values,valueMap,useMap)}}</view>
</view>
</view>
function getters(key, values, map, flag) {
return !flag ? values[key] : values[map[key]];
}
module.exports = {
getters: getters,
};
base-card-shop的js
useMap: {
type: Boolean,
value: true,
},
valueMap: {
type: Object,
value: {
titleVal: "code",
time: "time",
footTitle: "total",
footVal: "value",
stateInfo: "name",
stateVal: "state",
shopName: "shopName",
shopCode: "shopCode",
shopImg: "shopImg",
shopPrice: "shopPrice",
shopNum: "shopNum",
imgs: [],
purchaser: "purchaser",
purchaseNumber: "purchaseNumber",
},
},边栏推荐
- 记一篇IT培训日记067-好人感恩,坏人无错
- [browser principle] variable promotion
- Huawei equipment is configured with CE dual attribution
- 2022.02.28 - SX11-05. The largest rectangle in the histogram
- Step by step to create a trial version of ABAP program containing custom screen
- Classic case of solidity - Smart games
- ER diagram made by StarUML based on the last student achievement management system
- go net库(待续)
- (四)GoogleNet複現
- Five models of software testing
猜你喜欢

盒马,最能代表未来的零售

Apache Kylin 历险记

批量--04---移动构件

Axure RP 9 for Mac(交互式产品原型设计工具)中文版

redis 通用命令

MYSQL---服务器配置相关问题

Homology? Cross domain? How to solve cross domain problems?

C packing and unpacking
![Analysis of global and Chinese shipbuilding market in 2021: the global shipbuilding new orders reached 119.85 million dwt, with China, Japan and South Korea accounting for 96.58%[figure]](/img/3e/b54b7f15c4a6326d8c7c4433388a3a.jpg)
Analysis of global and Chinese shipbuilding market in 2021: the global shipbuilding new orders reached 119.85 million dwt, with China, Japan and South Korea accounting for 96.58%[figure]

< 山东大学软件学院项目实训 > 渲染引擎系统——基础渲染器(四)
随机推荐
2022.02.28 - SX11-05. The largest rectangle in the histogram
Escape rules and examples of go
面试:‘==‘与equals()之间的区别
思考游戏王决斗链接中抽卡概率问题
Web UI automation test
acwing 801. 二进制中1的个数(位运算)
Redis General Command
PHP builds a high-performance API architecture based on sw-x framework (II)
Saga architecture pattern: implementation of cross service transactions under microservice architecture
Unity get local video / download network video
位运算例题(待续)
Global and Chinese markets of three-phase induction motors 2022-2028: Research Report on technology, participants, trends, market size and share
读取mhd、raw图像并切片、归一化、保存
Multimix:从医学图像中进行的少量监督,可解释的多任务学习
[thinking about the process of structure optimization] how to build the evaluation ability of the impact of technical solutions
面试:什么是浅拷贝、深拷贝?
Getting started with JMeter
5-5配置Mysql复制 基于日志点的复制
一步步创建包含自定义 Screen 的 ABAP 程序的详细步骤
联通网管协议框图