got a radio button changes on click

This commit is contained in:
Chad Derya 2019-09-03 08:57:57 +01:00
parent 0902be2aff
commit 0873f5b8e4
4 changed files with 13 additions and 61 deletions

View File

@ -1,49 +0,0 @@
<template>
<el-dropdown :show-timeout="100" trigger="click">
<el-button plain>
{{ platform_selection === 'DE' ? 'Platform: DE' : 'Platform: UK' }}
<i class="el-icon-caret-bottom el-icon--right" />
</el-button>
<el-dropdown-menu slot="dropdown" class="no-padding dropdown-menu">
<el-dropdown-item>
<el-radio-group v-model="platform_selection" style="padding: 10px;">
<el-radio :value="DE">
DE
</el-radio>
<el-radio :value="UK">
UK
</el-radio>
</el-radio-group>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<script>
export default {
props: {
value: {
type: String,
default: 'DE'
}
},
computed: {
platform_selection: {
get() {
console.log(this.value)
return this.value
},
set(val) {
console.log(this.value)
this.$emit('input', val)
}
}
}
}
</script>
<style lang="scss" scoped>
.dropdown-menu {
z-index: 40000 !important;
}
</style>

View File

@ -1 +0,0 @@
export { default as PlatformDropdown } from './Platform'

View File

@ -23,24 +23,18 @@
<el-switch v-model="sidebarLogo" class="drawer-switch" />
</div>
<div class="drawer-item">
<span>Select Platform</span>
<PlatformDropdown v-model="postForm.platform_selection" />
</div>
</div>
</div>
</template>
<script>
import ThemePicker from '@/components/ThemePicker'
import { PlatformDropdown } from './Dropdown'
const defaultForm = {
platform_selection: 'DE'
}
export default {
components: { ThemePicker, PlatformDropdown },
components: { ThemePicker },
data() {
return {
postForm: Object.assign({}, defaultForm)
@ -87,10 +81,8 @@ export default {
key: 'theme',
value: val
})
},
selectPlatform(val) {
console.log(val)
}
}
}
</script>

View File

@ -2,6 +2,15 @@
<div class="dashboard-editor-container">
<github-corner class="github-corner" />
<el-radio v-model="platform" label="DE">
DE
</el-radio>
<el-radio v-model="platform" label="UK">
UK
</el-radio>
<h1>{{ platform }}</h1>
<panel-group @handleSetLineChartData="handleSetLineChartData" />
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
@ -85,7 +94,8 @@ export default {
},
data() {
return {
lineChartData: lineChartData.newVisitis
lineChartData: lineChartData.newVisitis,
platform: 'UK'
}
},
methods: {