I hereby claim:
- I am viclotana on github.
- I am viclotana (https://keybase.io/viclotana) on keybase.
- I have a public key ASBqk1d2MATu7YPVMEfFmjqoeLNfXPYNn7ebTxCB5x_EtQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Vue.mixin({ | |
mounted() { | |
console.log("hello world!"); | |
} | |
}); |
<script> | |
import clickMixin from '../Mixins/clickMixin' | |
export default { | |
name: 'Test', | |
mixins: [clickMixin] | |
} | |
</script> |
<template> | |
<div id="app"> | |
<img alt="Vue logo" src="./assets/logo.png" /> | |
<Test msg="Welcome to Your Vue.js App" /> | |
<modal /> | |
</div> | |
</template>; | |
<script> | |
import Test from "./components/Test.vue"; | |
import Modal from "./components/Modal.vue"; |
<template> | |
<div> | |
<button v-on:click="clicked('you just clicked on button 2')"> | |
Button 2 | |
</button> | |
</div> | |
</template>; | |
<script> | |
import clickMixin from "../Mixins/clickMixin"; | |
export default { |
<template> | |
<div> | |
<button v-on:click="clicked('you just clicked on button 1')"> | |
Button 1 | |
</button> | |
</div> | |
</template>; | |
<script> | |
import clickMixin from "../Mixins/clickMixin"; | |
export default { |
// src/mixins/clickMixin.js | |
export default { | |
methods: { | |
clicked(value) { | |
alert(value); | |
} | |
} | |
}; |
// define a mixin object | |
var myMixin = { | |
created: function() { | |
this.hello(); | |
}, | |
methods: { | |
hello: function() { | |
console.log("hello from mixin!"); | |
} | |
} |
<template> | |
<div id="app"> | |
<img alt="Vue logo" src="./assets/logo.png"> | |
<Test /> | |
<modal /> | |
</div> | |
</template>; | |
<script> | |
import Test from "./components/Test.vue"; | |
import Modal from "./components/Modal.vue"; |
// Component 2 | |
// src/components/Modal.vue | |
<template> | |
<div> | |
<button v-on:click="clicked('you just clicked on button 2')"> | |
Button 2 | |
</button> | |
</div> | |
</template>; |