Vue events
This commit is contained in:
parent
4925c969dd
commit
4f2d4fcd8a
|
@ -12,7 +12,7 @@
|
||||||
<div class="bd-settingSwitch">
|
<div class="bd-settingSwitch">
|
||||||
<div class="bd-title">
|
<div class="bd-title">
|
||||||
<h3>{{item.text}}</h3>
|
<h3>{{item.text}}</h3>
|
||||||
<div class="bd-switchWrapper" @click="() => toggle(item)">
|
<div class="bd-switchWrapper" @click="$emit('toggle', item)">
|
||||||
<input type="checkbox" class="bd-switchCheckbox" />
|
<input type="checkbox" class="bd-switchCheckbox" />
|
||||||
<div class="bd-switch" :class="{'bd-checked': item.status.update}" />
|
<div class="bd-switch" :class="{'bd-checked': item.status.update}" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -23,6 +23,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ['item', 'toggle']
|
props: ['item']
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<div class="bd-formDivider"></div>
|
<div class="bd-formDivider"></div>
|
||||||
<div v-for="update in bdUpdates">
|
<div v-for="update in bdUpdates">
|
||||||
<UpdaterStatus :item="update" v-if="update.status.updating" />
|
<UpdaterStatus :item="update" v-if="update.status.updating" />
|
||||||
<UpdaterToggle :item="update" :toggle="() => updater.toggleUpdate(update)" v-else />
|
<UpdaterToggle :item="update" @toggle="updater.toggleUpdate(update)" v-else />
|
||||||
<div class="bd-formDivider"></div>
|
<div class="bd-formDivider"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,6 +22,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ['item', 'onClick', 'checked']
|
props: ['item', 'checked']
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="bd-button" :class="classes" @click="onClick">
|
<div class="bd-button" @click="$emit('click')">
|
||||||
{{text}}
|
{{text}}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ['classes', 'text', 'onClick']
|
props: ['text']
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -9,15 +9,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="bd-buttonGroup" :class="classes">
|
<div class="bd-buttonGroup">
|
||||||
<Button v-for="(button, index) in buttons" :text="button.text" :classes="button.classes" :onClick="button.onClick" :key="index"/>
|
<Button v-for="(button, index) in buttons" :text="button.text" :classes="button.class" @click="button.onClick" :key="index"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Button from './Button.vue';
|
import Button from './Button.vue';
|
||||||
export default {
|
export default {
|
||||||
props: ['buttons', 'classes'],
|
props: ['buttons'],
|
||||||
components: { Button }
|
components: { Button }
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -101,15 +101,15 @@ module.exports = (Plugin, Api, Vendor) => {
|
||||||
if (!returnValue.props.children instanceof Array) returnValue.props.children = [returnValue.props.children];
|
if (!returnValue.props.children instanceof Array) returnValue.props.children = [returnValue.props.children];
|
||||||
// Add a generic Button component provided by BD
|
// Add a generic Button component provided by BD
|
||||||
returnValue.props.children.push(Api.Components.ButtonGroup({
|
returnValue.props.children.push(Api.Components.ButtonGroup({
|
||||||
classes: [ 'exampleBtnGroup' ], // Additional classes for button group
|
class: [ 'exampleBtnGroup' ], // Additional classes for button group
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
classes: ['exampleBtn'], // Additional classes for button
|
class: ['exampleBtn'], // Additional classes for button
|
||||||
text: 'Hello World!', // Text for button
|
text: 'Hello World!', // Text for button
|
||||||
onClick: e => Logger.log('Hello World!') // Button click handler
|
onClick: e => Logger.log('Hello World!') // Button click handler
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
classes: ['exampleBtn'],
|
class: ['exampleBtn'],
|
||||||
text: 'Button',
|
text: 'Button',
|
||||||
onClick: e => Logger.log('Button!')
|
onClick: e => Logger.log('Button!')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue