简体   繁体   English

在带有 Nativescript-Vue 的 v-for 中使用 fontawesome 图标时出现问题

[英]Issue using fontawesome icons inside v-for with Nativescript-Vue

I'm having problems using fontawesome lib with nativescript-vue inside v-for loop, I have no problem displaying fonts normally but I can't get it to work when they are data-binded inside my v-for loop.我在 v-for 循环中使用带有 nativescript-vue 的 fontawesome lib 时遇到问题,我正常显示 fonts 没有问题,但是当它们在我的 v-for 循环中进行数据绑定时,我无法让它工作。 My code:我的代码:

<FlexBoxLayout style="width:100%; height:80px; align-items:center; justify-content:space-around; background-color:rgb(235,235,235);  align-self:flex-end;">
            <FlexBoxLayout v-for="link in nav" :key="link.title" style="width:auto; height:100%; flex-direction:column; align-items:center; justify-content:center;">
                <Label :text="link.icon | fonticon" class="fa c_normal fs_normal"><!--THIS LINE TRIGGERS THE ERROR-->
                <Label :text="link.title" class="fs_normal c_normal"/>
            </FlexBoxLayout>
        </FlexBoxLayout>

I'm getting a template compilling error:我收到模板编译错误:

ERROR in ./components/App.vue?vue&type=template&id=45ba5ed4&scoped=true& (../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../node_modules/vue-loader/lib??vue-loader-options!./components/App.vue?vue&type=template&id=45ba5ed4&scoped=true&)
Module Error (from ../node_modules/vue-loader/lib/loaders/templateLoader.js):
(Emitted value instead of an instance of Error)
  Error compiling template:

  <Page class="blg">
      ...
  </Page>

  - [object Object]

 @ ./components/App.vue?vue&type=template&id=45ba5ed4&scoped=true& 1:0-213 1:0-213
 @ ./components/App.vue
 @ ./main.js
File change detected. Starting incremental webpack compilation...

You do not seem to have a closing tag on the Label .您似乎在Label上没有结束标签。

    <FlexBoxLayout style="width:100%; height:80px; align-items:center; justify-content:space-around; background-color:rgb(235,235,235); align-self:flex-end;"> 
        <FlexBoxLayout v-for="link in nav" :key="link.title" style="width:auto; height:100%; flex-direction:column; align-items:center; justify-content:center;">     
           <Label :text="link.icon | fonticon" class="fa c_normal fs_normal" /> 
             <Label :text="link.title" class="fs_normal c_normal"/>
         </FlexBoxLayout>
     </FlexBoxLayout>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM