V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
xiaoyanbot
V2EX  ›  问与答

vue.js2.0 在 iOS9.3.2 版本的兼容性问题如何解决

  •  
  •   xiaoyanbot · 2017-11-15 22:36:54 +08:00 · 4314 次点击
    这是一个创建于 2381 天前的主题,其中的信息可能已经有所发展或是发生改变。

    大家有没有遇到 vue.js2.0 版本开发的页面在 iOS9.3.2 版本遇到兼容性的问题,会暴露 vue.js 的渲染代码,是怎么解决的?

    3 条回复    2017-11-20 20:43:26 +08:00
    whypool
        1
    whypool  
       2017-11-15 22:41:06 +08:00
    并不是兼容问题,是你代码没写对;多看文档啊骚年;
    {{}}这样的预渲染代码块可以用 v-text 绑定数据,也可以用 template 标签包起来
    xiaoyanbot
        2
    xiaoyanbot  
    OP
       2017-11-16 12:06:57 +08:00
    @whypool https://cn.vuejs.org/v2/api/#v-text
    在官方文档里,两者是等同的啊。
    <div class="center_content" v-for='(ele,index) in goods' :key="ele.good_id">
    <div class="left">
    <img :src="ele.image_url" />
    </div>
    <div class="right">
    <p>{{ele.name}}</p>
    <p>材质:<span>{{ele.material}}</span></p>
    <p>规格:<span>{{ele.spec}}</span></p>
    </div>
    <div class="btn">
    <a @touchend="changegood(ele.good_id,ele.price)" style="text-decoration: none;color: #fff">替换</a>
    </div>
    </div>
    我这样有什么问题么?在 Android 和 iOS11.0.3 上都可以正常渲染的。
    我去试试用 template 标签包起来的方法
    <template v-for='(ele,index) in goods' :key="ele.good_id">
    <div class="center_content">
    <div class="left">
    <img :src="ele.image_url" />
    </div>
    <div class="right">
    <p>{{ele.name}}</p>
    <p>材质:<span>{{ele.material}}</span></p>
    <p>规格:<span>{{ele.spec}}</span></p>
    </div>
    <div class="btn">
    <a @touchend="changegood(ele.good_id,ele.price)" style="text-decoration: none;color: #fff">替换</a>
    </div>
    </div>
    <template>
    xiaoyanbot
        3
    xiaoyanbot  
    OP
       2017-11-20 20:43:26 +08:00
    再次顶帖子
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1240 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 18:16 · PVG 02:16 · LAX 11:16 · JFK 14:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.