Skip to content

Multiple nested template, can not be rendered in ios #1118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ruohuan opened this issue Aug 5, 2015 · 6 comments
Closed

Multiple nested template, can not be rendered in ios #1118

ruohuan opened this issue Aug 5, 2015 · 6 comments

Comments

@ruohuan
Copy link

ruohuan commented Aug 5, 2015

Issues, such as shown in the title
An example:

<template lang="jade">
.select-package
  dl(v-repeat="items")
    template(v-if="groupName=='1个号码套餐'")
      template(v-if="isFirstMonth")
        dt {{groupName}}
        dd(v-repeat="item" v-on="click:onChoose(itemId,skuId,isFirstMonth)")
          span {{skuName}}
      template(v-if="!isFirstMonth")
        dt {{groupName}}
        dd(v-repeat="item" v-on="click:onChoose(itemId,skuId,isFirstMonth)" v-show="skuId!=='0'")
          span {{skuName}}
</template>

For example shown,template(v-if="isFirstMonth") and template(v-if="!isFirstMonth") inside the content will not be rendered in ios, but Android is ok.

@JellyBool
Copy link

use english(还是使用英文吧)

codes should place like this

.select-package
dl(v-repeat="items")
template(v-if="groupName=='1个号码套餐'")
template(v-if="isFirstMonth")
dt {{groupName}}
dd(v-repeat="item" v-on="click:onChoose(itemId,skuId,isFirstMonth)")
span {{skuName}}
template(v-if="!isFirstMonth")
dt {{groupName}}
dd(v-repeat="item" v-on="click:onChoose(itemId,skuId,isFirstMonth)" v-show="skuId!=='0'")
span {{skuName}}


@ruohuan ruohuan changed the title template多次嵌套(一般两次也会遇到这种情况),在ios下无法渲染 Multiple nested template, can not be rendered in ios Aug 5, 2015
@yyx990803
Copy link
Member

Are you using the latest version? (0.12.9)
There was a fix in 0.12.9 that is related to nested templates in Safari.

If this still happens in 0.12.9, please provide a jsfiddle reproduction.

@fychinesepjj126
Copy link

Can Vue.js provide a new directive like v-else , worked with v-if?
Maybe, it will be:

  1. more concise syntax (use v-else, instead of v-if="!isFirstMonth")
  2. easy to use (use the scene more)

@ruohuan
Copy link
Author

ruohuan commented Aug 7, 2015

Here is a demo: https://jsfiddle.net/kzxu9ceq/

@Pandahisham
Copy link

+1 with v-else , maybe a v-empty also , since when composing views these three conditions are most common , 1. there's nothing to show , 2. there's something to show , 3. there's something but it's different / needs adjusting

@ghost
Copy link

ghost commented Jul 8, 2016

This is happening to me when try to create and alternate grid like:

+---+---+
| a | b |
+---+---+
| b | a |
+---+---+
| a | b |
+---+---+

Using the v-if with $index:

  <div class="container-fluid">
    <div class="row equal hidden-xs hidden-sm debug" v-for="service in services">
      <!-- Left -->
      <div class="col-md-6 service-text left debug" style="background-color: [[service.background]];" v-if="($index%2) === 0">
        <h3 class="font-white">[[service.title]]</h3><p class="font-family-lato font-white">[[service.body]]</p>
      </div>
      <div class="col-md-6 service-banner debug" v-bind:style="{'background-image': 'url('+service.banner.img+')'}" v-else></div>
      <!-- Right -->
      <div class="col-md-6 service-banner debug" v-bind:style="{'background-image': 'url('+service.banner.img+')'}" v-if="($index%2) === 0"></div>
      <div class="col-md-6 service-text right debug" style="background-color: [[service.background]];" v-else>
        <h3 class="font-white">[[service.title]]</h3><p class="font-family-lato font-white">[[service.body]]</p>
      </div>
    </div>
  </div> <!-- container-fluid -->

Safari:

  • version 9.1.1 (11601.6.17)

OS X:

  • version: El Captain 10.11.5 (15F34)

VueJS:

  • version: 1.0.26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants