FupingQiu / okrsw

0 stars 0 forks source link

v-if 对应的元素中,reveal无法弹出模拟框,不生效 #18

Open FupingQiu opened 5 years ago

FupingQiu commented 5 years ago

以下代码 vue组件中,其中,user的确是null的,可以显示“show-modal” button,但是对应的exampleModal1模拟框不生效:

<template v-if="user == null">
  <div class="reveal" id="exampleModal1" data-reveal>
    <h1>Awesome. I Have It.</h1>
    <button class="close-button" data-close aria-label="Close modal" type="button">
      <span aria-hidden="true">&times;</span>
    </button>
  </div>
</template>
<p><button class="button" data-open="exampleModal1">show-modal</button></p>
FupingQiu commented 5 years ago

排除法: 1.foundation.****.js 已经成功引入;--查看app.js; 2.$(document).ready(founction(){ $(document).foundation();});也进行初始化了 3.在其他 vue 组件新建

,并将 reveal 创建,可以成功。

为何v-if="user == null"不能渲染或执行里面的js呢?