我在做 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
}
}
});
我发现 取消上面两个自定义组件 在手机端就好用了 :sob: