Javascript 将Facebook像素添加到Vue.js索引文件

Javascript 将Facebook像素添加到Vue.js索引文件,javascript,facebook,vue.js,pixel,Javascript,Facebook,Vue.js,Pixel,我在这里添加了代码: FB像素在我的项目中不起作用。 也许我必须添加更多的代码片段,这些代码片段将真正起作用。期待您的帮助!!:)当我在最后一张卡片部分下添加像素片段时,卡片没有显示出来,但像素起作用 此项目位于vue.js中 代码: {{$fetchState.error.message} 从“~/components/Card.vue”导入卡 //从“axios”导入axios 导出默认值{ 数据(){ 返回{ 挑战:[], snackbar:false, 短信:“你好,我是一个小吃店”,

我在这里添加了代码:

FB像素在我的项目中不起作用。 也许我必须添加更多的代码片段,这些代码片段将真正起作用。期待您的帮助!!:)当我在最后一张卡片部分下添加像素片段时,卡片没有显示出来,但像素起作用

此项目位于vue.js中

代码:


{{$fetchState.error.message}

从“~/components/Card.vue”导入卡 //从“axios”导入axios 导出默认值{ 数据(){ 返回{ 挑战:[], snackbar:false, 短信:“你好,我是一个小吃店”, } }, 安装的(){ //这是。$fetch() }, 计时器:{ //日志:{time:1000,autostart:true,repeat:true} }, 异步获取(){ const challenges=wait fetch(process.env.BASE_URL+`/api/challenges`)。然后((res)=>res.json() 控制台日志(“获取”); this.challenges=challenges.data }, fetchOnServer:false, 组成部分:{ 卡片 }, 方法:{ 日志(){ console.log('Hello world') } } }
这是实际像素:
<template>

 <div>
  <div class="row" >

    <template v-if="$fetchState.pending">

 </div>
   </template>
   <template v-else-if="$fetchState.error">
     <p>{{ $fetchState.error.message }}</p>
   </template>

   <template v-else>
     

     <div class="row columns is-multiline">

        <div class="column is-half"
         v-for="item in challenges"
         :key="item.count"

       >

       <card
         :challenge-title="item.title"
         :challenge-description="item.description"
         :challenge-company-name="item.company_name"
         :challenge-id="item.id"
         :challenge-teams-max="item.teams_max"
         :challenge-prize="item.prize"
         :challenge-duration="item.duration"
         :challenge-cover="item.cover_card.uuid"
         :challenge-logo="item.company_logo.uuid"
         />
       </div>

   </div>

</template>


</div>

</div>
</template>


<script>

 import Card from '~/components/Card.vue'
 // import axios from 'axios'

export default {

  data() {
    return {
      challenges: [],
      snackbar: false,
      text: 'Hello, I\'m a snackbar',
    }
  },
  mounted(){
    // this.$fetch()
  },
  timers: {
    // log: { time: 1000, autostart: true, repeat: true }
  },
  async fetch() {

    const challenges = await fetch(process.env.BASE_URL + `/api/challenges`).then((res) => res.json())
    console.log("FETCH");
    this.challenges = challenges.data
  },
  fetchOnServer: false,


  components: {
    Card
  },
  methods:{
    log () {
      console.log('Hello world')
    }
  }


}


</script>