2018-05-01から1ヶ月間の記事一覧
methods: { testFunc() { console.log('OK'); } }, mounted() { setTimeout(function(){ this.testFunc(); // エラー }, 1000); } this.testFunc() だとエラー。以下に訂正 mounted() { var self = this; setTimeout(function(){ self.testFunc(); // OK },…
computed: { swiper() { return this.$refs.swiper.swiper },} この swiper を孫以降の component で共有したい場合 provide - inject >>> provide は data, method しか共有できない mixin >>> this.$refs が使えない Vuex の state で共有 >>> 〇 親 compo…
大規模開発のため vuex の store.js をモジュール化すると各 component から vuex の action をインポートした際、action がどこのモジュールに含まれているかわからなくなってくる。 @store.js import Vue from 'vue'; import Vuex from 'vuex'; import act…
親子ならprops で可能だが、孫などには provide, injection を使う vuejs.org ただし共有できるのは data, method で computed はできない。 The provide options allows us to specify the data/methods we want to provide to descendent components. では…
updated: 2018/7/8 sdparm を使用して HDD のスピンを制御するときのコマンド sudo sdparm --command=stop /dev/sda1 のショートカットを作る >>>> 今あるショートカットの確認 >>> alias 新規にショートカットの登録 cd home/pi sudo nano /.bashrc 元…
updated: 2018/5/2 この記事は検証途中で内容が不正確 方法1 Laravel Mix から @webpack.mix.js let webpack = require('webpack'); mix.webpackConfig({ plugins: [ new webpack.ProvidePlugin({ $: 'jquery', jquery: 'jquery', window.jquery: 'jquery' …