我在做 Laravel 与 Vue 组件结合时, Vue的所有功能在PC上都好使用,但是在手机端都不好使,这是什么原因?

/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */

require('./bootstrap');

window.Vue = require('vue').default;

/**
 * The following block of code may be used to automatically register your
 * Vue components. It will recursively scan this directory for the Vue
 * components and automatically register them with their "basename".
 *
 * Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
 */

Vue.component('like-component', require('./components/like/Like').default);
Vue.component('share-component', require('./components/share/Share').default);

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

const app = new Vue({
    el: '#app',
    data() {
        return {
            isShow: false,
            isOpen: false,
        }
    },
    methods: {
        onChange() {
            this.isShow = !this.isShow
        },
        onOpen() {
            this.isOpen = !this.isOpen
        }
    }
});
全站厨师
GalaxyNo_1
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 1
GalaxyNo_1

我发现 取消上面两个自定义组件 在手机端就好用了 :sob:

3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!