每个循环需有规范,wx:key要设置才不会报这个警告
请问这种报错是什么意思?如何解决?请问这种报错是什么意思?如何解决?代码如下图 [图片] [图片]
2018-11-25你可以限制数字所在的view的宽高,清除默认行间距
这段代码在不同的手机型号下会有很大出入 【官方帮忙看下】<!--index.wxml--> <view style="transform:translateY(-80rpx)" class="transtion"> <view>0</view> <view>1</view> <view>2</view> <view>3</view> <view>4</view> <view>5</view> <view>6</view> <view>7</view> <view>8</view> <view>9</view> </view> <view style="transform:translateY(-160rpx)" class="transtion"> <view>0</view> <view>1</view> <view>2</view> <view>3</view> <view>4</view> <view>5</view> <view>6</view> <view>7</view> <view>8</view> <view>9</view> </view> <view style="transform:translateY(-240rpx)" class="transtion"> <view>0</view> <view>1</view> <view>2</view> <view>3</view> <view>4</view> <view>5</view> <view>6</view> <view>7</view> <view>8</view> <view>9</view> </view> <view style="transform:translateY(-320rpx)" class="transtion"> <view>0</view> <view>1</view> <view>2</view> <view>3</view> <view>4</view> <view>5</view> <view>6</view> <view>7</view> <view>8</view> <view>9</view> </view> <view style="transform:translateY(-400rpx)" class="transtion"> <view>0</view> <view>1</view> <view>2</view> <view>3</view> <view>4</view> <view>5</view> <view>6</view> <view>7</view> <view>8</view> <view>9</view> </view> <view style="transform:translateY(-480rpx)" class="transtion"> <view>0</view> <view>1</view> <view>2</view> <view>3</view> <view>4</view> <view>5</view> <view>6</view> <view>7</view> <view>8</view> <view>9</view> </view> <view style="transform:translateY(-560rpx)" class="transtion"> <view>0</view> <view>1</view> <view>2</view> <view>3</view> <view>4</view> <view>5</view> <view>6</view> <view>7</view> <view>8</view> <view>9</view> </view> <view style="transform:translateY(-640rpx)" class="transtion"> <view>0</view> <view>1</view> <view>2</view> <view>3</view> <view>4</view> <view>5</view> <view>6</view> <view>7</view> <view>8</view> <view>9</view> </view> <view style="transform:translateY(-720rpx)" class="transtion"> <view>0</view> <view>1</view> <view>2</view> <view>3</view> <view>4</view> <view>5</view> <view>6</view> <view>7</view> <view>8</view> <view>9</view> </view> <view style="transform:translateY(-800rpx)" class="transtion"> <view>0</view> <view>1</view> <view>2</view> <view>3</view> <view>4</view> <view>5</view> <view>6</view> <view>7</view> <view>8</view> <view>9</view> </view> CSS page{ background:#000; } .transtion{ transition:all 3s; display: inline-block; } .transtion view{ padding:0; margin:0; height:80rpx; font-weight:bold; font-size:33px; width:30px; display:flex; align-items:center; flex-direction:column; justify-content:center; color:#fff; } [图片] 不能理解这个rpx为什么会有这么大出入, 苹果手机依次向下, 安卓大屏依次向上, 一部分安卓依次向下, 目前没有发现正常的 9个数全部对齐的,经过测试和手机分辨率有关,请求帮助
2018-11-25它默认接收的字符串,你要转成Json
从获取的json数据里不能提取想要的数据从一个后台获取到JSON数据,形如:"{ kinds:[{ID:1,Name:\"空调\"},{ID:2,Name:\"冰箱\"}]}",下面是获取成功后的代码片断: success(res) { //var kinds = res.data.kinds; //是一个数组,[{ID:1,Name:\"空调\"},{ID:2,Name:\"冰箱\"},{ID:12,me:\"tttt001\"}] var data=res.data; console.log(data); var kinds = data.kinds; console.log(kinds); }, data控制台里显示是正常的,但提取kinds却是未定义,分别提示如下: { kinds:[{ID:1,Name:"空调"},{ID:2,Name:"冰箱"}]} undefined 截图如下: [图片] 实在是百思不得其解,请高手指点,谢谢大家!
2018-11-20