updated: 2020/10/5
<v-dialog
v-model="dialog"
@close="close">
** dialog に input を含む場合は@input="v => v || close()"
** v => v はアロー関数
methods: {
close() {
console.log("closed")
},
ref:
developer.mozilla.orgdeveloper.mozilla.org
updated: 2020/10/5
<v-dialog
v-model="dialog"
@close="close">
** dialog に input を含む場合は@input="v => v || close()"
** v => v はアロー関数
methods: {
close() {
console.log("closed")
},
ref:
developer.mozilla.orgdeveloper.mozilla.org
vue-konva の transform がモバイルに対応していなかったので。。。
<template>
<div id="some-component">
</div>
</template>
<script>
import Konva from 'konva'
export default {
mounted() {
let stage = new Konva.Stage()
error: Konva is undefined
</script>
import {Konva} from 'konva'
error: Stage is undefined
------------------------solution-----------------------------------
import * as Konva from 'konva'
works correctly
referrence:
updated: 2019/1/21
jimp で加工した list 表示でうまく表示タイミングが調整出来なくて加工前や表示自体されなくて躓いた
理由)
Due to limitations in JavaScript, Vue cannot detect the following changes to an array:
vm.items[indexOfItem] = newValue
vm.items.length = newLength
For example:
var vm = new Vue({ |
解)Vue.set() を使う
To overcome caveat 1, both of the following will accomplish the same as vm.items[indexOfItem] = newValue
, but will also trigger state updates in the reactivity system:
// Vue.set |
// Array.prototype.splice |
You can also use the vm.$set
instance method, which is an alias for the global Vue.set
:
参照:
update:
Vue.set() を使わなくても v-for に :key を付加させれば`dynamic にlist 表示することができた
→ @click="method1() & method2()"
& でつなげれば出来る
ここで()をつけないでメソッド名だけでは動作しない。
&無しの単体のメソッドならば()は不要
別途両方を実行するメソッドを作ってもいいが mixin や vuex で作ったものを2つ利用したいときに無駄にメソッドを増やさなくて済む。
vue-router の meta が便利
これで $route.meta.profile に値が付くので
v-if="this.$route.meta.profile" 等でブラウザバックにも対応した routing ごとの conditional rendering ができて便利
フロントからクエリパラメーターを二つ付けて送った
where では intval() で型を変える必要があったがforPage() では $request->page のままで処理が可能だったことに注意