Javascript 从插件vue设置属性值
我已经安装了这个插件: 我需要编辑道具:从app.js中的这个插件中启用 我的应用程序中有以下代码:Javascript 从插件vue设置属性值,javascript,vue.js,vuejs2,Javascript,Vue.js,Vuejs2,我已经安装了这个插件: 我需要编辑道具:从app.js中的这个插件中启用 我的应用程序中有以下代码: import Affix from 'vue-affix'; var affix = Vue.use(Affix); const app = new Vue({ el: '#app', data() { }, mounted() { this.usePushStateForTabs('.spark-tabs'); this.c
import Affix from 'vue-affix';
var affix = Vue.use(Affix);
const app = new Vue({
el: '#app',
data() {
},
mounted() {
this.usePushStateForTabs('.spark-tabs');
this.calcStickyWidth();
this.$nextTick(function() {
window.addEventListener('resize', this.calcStickyWidth);
})
},
methods: {
calcStickyWidth() {
let width = $('.vue-affix').parent().width();
$('.vue-affix').css('width', width + 'px');
if(! this.isMobile) { affix.enabled = false; }
},
isMobile() {
return $(window).width() > 768 ? true : false
},
}
});
我需要将启用的道具设置为false
。但我的解决方案不起作用。我没有定义。请帮忙修理一下