微信小程序开发里面,虽然不支持<component is=""/> is not supported,但是微信小程序提供了WXML提供模板(template),<template is="msgItem" data="{{...item}}"/>
,对于uniapp并不管用,编译后,所以解决方案,只有目前(截止2022-04-15)只有两个:
1.使用 v-if,遍历组件,判断位置,来显示组件,达到排列要求
2.第二种没那么麻烦,比较神奇,使用flex布局的order属性,外层设置
display: flex;
flex-direction: column;
里面组件的div,就设置order,越小越在前。所以我只要操控,每个组件的order值就好了
1 个评论
要回复文章请先登录或注册
wanghexu (作者)