【问题标题】:Laravel Nova override vue component resulting [Vue warn]: Error compiling templateLaravel Nova 覆盖 vue 组件导致 [Vue 警告]:编译模板时出错
【发布时间】:2021-06-08 01:00:02
【问题描述】:

我想使用它来实现用户指南 https://github.com/shipshapecode/vue-shepherd 在我的新星上。

我将文件 webpack.mix.js.dist 更改为 webpack.mix.js(在 nova 目录中)。

然后我做了:

npm install
npm run watch

并在 /nova/resources/js/views/index.vue 中进行了一些更改 还有 /nova/resources/js/components.js

/nova/resources/js/components.js

import VueShepherd from 'vue-shepherd'

Vue.use(VueShepherd)

/nova/resources/js/views/index.vue

 mounted() {
    this.$nextTick(() => {
      const tour = this.$shepherd({
        useModalOverlay: true
      });
      console.log(tour);

      tour.addStep({
        attachTo: { element: this.$el, on: 'top' },
        text: 'Test'
      });

      tour.start();
    });
  },

然后我跑

php artisan nova:publish

但现在我的控制台出现了这个错误

为什么会发生以及如何避免该错误? 谢谢

【问题讨论】:

    标签: javascript laravel vue.js vue-component laravel-nova


    【解决方案1】:

    你的svg中有标签样式,vue不允许使用标签和inside,所以,

    1. 从您的 svg 中删除标签
    2. 或将其用作

    【讨论】:

      猜你喜欢
      • 2019-02-27
      • 2019-10-09
      • 2020-04-01
      • 1970-01-01
      • 2020-02-22
      • 2019-02-22
      • 2019-04-02
      • 2021-05-11
      • 2021-05-27
      相关资源
      最近更新 更多