<template>
<child v-bind:left.sync="parentLeft" v-bind:right.sync="parentLeft"></child>
</template>
this.$emit("update:left", true);
this.$emit("update:right", true);
<template>
<ul>
<li v-for="item in $options.myArray"></li>
</ul>
</template>
export default {
data() {
return {
someReactiveData: [1, 2, 3]
};
},
//custom option name myArray
myArray: null,
created() {
//access the custom option using $options
this.$options.myArray = ["value 1", "value 2"];
}
};
<div @click="onClick($event)"></div>
<script>
export default {
methods: {
onClick(event) {
// here
}
}
};
</script>
export default {
watch: {
item: {
handler(val) {
// do stuff
},
deep: true
}
}
};
<style scoped>
.a >>> .b {
/* ... */
}
</style>
will compile as
<style>
.a[data-v-f3f3eg9] .b { /* ... */ } `
</style>