当前位置:网站首页>Dynamic sorting of DOM object element blocks in applets
Dynamic sorting of DOM object element blocks in applets
2022-07-29 05:32:00 【crystal lattices 】
Given the following applet wxml Layout example for :
<view>
<view>A What's in the block ,...</view>
<view>B What's in the block ,...</view>
<view>C What's in the block ,...</view>
<view>D What's in the block ,...</view>
<view>E What's in the block ,...</view>
</view>According to the new requirements , Enter the interface from different entrances , Different content blocks need to be displayed at the top , The original requirements can no longer meet the requirements .
New requirements , When from “C block ” When you click the entry to enter this interface , You need to display the following :
<view>
<view>C What's in the block ,...</view>
<view>A What's in the block ,...</view>
<view>B What's in the block ,...</view>
<view>D What's in the block ,...</view>
<view>E What's in the block ,...</view>
</view>If it is Jquery Words , It may be better to think of a solution , Direct manipulation DOM object , take C The block moves to the front , however , Applet does not support Jquery operation .
Solution :
Use the applet wx:for Cycle through all block contents , Define a list :
items = ['A', 'B&
边栏推荐
- Detailed explanation of GPIO input and output
- The function of using wechat applet to scan code to log in to the PC web of the system
- 来!看排名一年上升16位的ClickHouse,如何在京东落地实践
- 抢先预约 | 阿里云无影云应用线上发布会预约开启
- 【C语言系列】—三种方法模拟实现strlen库函数的方法
- 365天挑战LeetCode1000题——Day 036 二叉树剪枝 + 子数组和排序后的区间和 + 删除最短的子数组使剩余数组有序
- 全局components组件注册
- Allocate memory: malloc() and free()
- Cryengine3 debugging shader method
- 文件结尾
猜你喜欢

Together with digital people, digital space and XR platform, Alibaba cloud and its partners jointly build a "new vision"

Day 1

QT series - Installation

刷题狂魔—LeetCode之剑指offer58 - II. 左旋转字符串 详解

JD cloud and Forrester consulting released a hybrid cloud report that cloud Nativity has become a new engine driving industrial development

During the appointment, the 2022 JD cloud industrial integration new product launch was launched online

Live broadcast preview | how to improve enterprise immunity through "intelligent edge security"?

C语言 一级指针

【C语言系列】— 把同学弄糊涂的 “常量” 与 “变量”

Alibaba cloud Zhang Xintao: heterogeneous computing provides surging power for the digital economy
随机推荐
科班同学真的了解未来的职业规划吗?
实现简单的数据库查询(不完整)
Li Yan, CEO of parallel cloud: cloudxr, opens the channel to the metauniverse
Alibaba cloud and Dingjie software released the cloud digital factory solution to realize the localized deployment of cloud MES system
阿里云架构师细说游戏行业九大趋势
In depth analysis of common cross end technology stacks of app
浅谈范式
阿里云张新涛:异构计算为数字经济提供澎湃动力
文件结尾
Helm chart for Kubernetes
Day 5
ANSI C类型限定符
365 day challenge leetcode 1000 questions - day 037 elements and the maximum side length of squares less than or equal to the threshold + the number of subsequences that meet the conditions
Yangyonglin, vice president of Rushi Technology: when traditional industries encounter "digital space"
Terminal shell common commands
数千个数据库、遍布全国的物理机,京东物流全量上云实录 | 卓越技术团队访谈录
ANSI C type qualifier
Camunda 1. Camunda workflow - Introduction
With cloud simulation platform, Shichuang technology supports the upgrading of "China smart manufacturing"
携手数字人、数字空间、XR平台,阿里云与伙伴共同建设“新视界”